aboutsummaryrefslogtreecommitdiffstats
path: root/lib/concepts/Hash.ml
diff options
context:
space:
mode:
authorEstevan Castilho <tevo@riajuu.net>2026-07-15 01:52:38 +0000
committerGitHub <noreply@github.com>2026-07-14 22:52:38 -0300
commitc374635a36d71e8cfff6e1c19b62e5d0e14ea371 (patch)
tree597fba69d4b39452eabab6299887282c1d7c6bc6 /lib/concepts/Hash.ml
parentbb3156b8ab78b035ce886bbe3021ec7cbe269d03 (diff)
downloadRNT-c374635a36d71e8cfff6e1c19b62e5d0e14ea371.tar.gz
RNT-c374635a36d71e8cfff6e1c19b62e5d0e14ea371.zip
Storage layer scaffolding, LMDB backend
Diffstat (limited to '')
-rw-r--r--lib/concepts/Hash.ml10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/concepts/Hash.ml b/lib/concepts/Hash.ml
index 681ec4a..106e731 100644
--- a/lib/concepts/Hash.ml
+++ b/lib/concepts/Hash.ml
@@ -1,5 +1,7 @@
-type hash = bytes
+type hash = Digestif.SHA256.t
-let hash_of_value (_ : Value.value) = failwith "TODO"
-let hash_equals (_ : hash) (_ : hash) = failwith "TODO"
-let bytes_of_hash (h : hash) = h
+let hash_of_value (v : Value.value) =
+ Representation.(blob_of_value v |> bytes_of_blob) |> Digestif.SHA256.digest_bytes
+
+let hash_equals = Digestif.SHA256.equal
+let bytes_of_hash (h : hash) = Bytes.of_string (Digestif.SHA256.to_raw_string h)