From c374635a36d71e8cfff6e1c19b62e5d0e14ea371 Mon Sep 17 00:00:00 2001 From: Estevan Castilho Date: Wed, 15 Jul 2026 01:52:38 +0000 Subject: Storage layer scaffolding, LMDB backend --- lib/concepts/Hash.ml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'lib/concepts/Hash.ml') 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) -- cgit v1.2.3