From 8f87d272038ddea11c366d9a14079666daf6628b Mon Sep 17 00:00:00 2001 From: Estevan Castilho Date: Sun, 23 Aug 2026 03:52:08 +0000 Subject: The branch manager should persist changes to the root --- lib/concepts/Hash.ml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/concepts/Hash.ml') diff --git a/lib/concepts/Hash.ml b/lib/concepts/Hash.ml index ae0a178..b2ed4b2 100644 --- a/lib/concepts/Hash.ml +++ b/lib/concepts/Hash.ml @@ -11,6 +11,10 @@ let hash_of_bytes bytes = Digestif.SHA256.digest_bytes bytes let hash_of_blob blob = Blob.bytes_of_blob blob |> Digestif.SHA256.digest_bytes +let bytes_of_hash (h : hash) = Bytes.of_string (Digestif.SHA256.to_raw_string h) + +let blob_of_hash h = bytes_of_hash h |> Blob.blob_of_bytes + let to_raw_string hash = Digestif.SHA256.to_raw_string hash let of_raw_string str = Digestif.SHA256.of_raw_string str @@ -18,7 +22,6 @@ let of_raw_string str = Digestif.SHA256.of_raw_string str let to_hum_string hash = Digestif.SHA256.to_hex hash let hash_equals = Digestif.SHA256.equal -let bytes_of_hash (h : hash) = Bytes.of_string (Digestif.SHA256.to_raw_string h) let power_of_two p = let b = Bytes.make 32 '\x00' in -- cgit v1.2.3