aboutsummaryrefslogtreecommitdiffstats
path: root/lib/concepts/Hash.ml
diff options
context:
space:
mode:
authorMarcos Magueta <maguetamarcos@gmail.com>2026-09-25 21:51:33 -0300
committerMarcos Magueta <maguetamarcos@gmail.com>2026-09-25 21:51:33 -0300
commit584fbca6d920e9a9f91d451667f9380714ac2175 (patch)
treea163b916a6f8cb550c8b38ceb01ab01558687a40 /lib/concepts/Hash.ml
parentc7b754e96714eeeb9d315ee3de402d73a27d47db (diff)
downloadRNT-584fbca6d920e9a9f91d451667f9380714ac2175.tar.gz
RNT-584fbca6d920e9a9f91d451667f9380714ac2175.zip
dune fmt
Diffstat (limited to 'lib/concepts/Hash.ml')
-rw-r--r--lib/concepts/Hash.ml13
1 files changed, 2 insertions, 11 deletions
diff --git a/lib/concepts/Hash.ml b/lib/concepts/Hash.ml
index 5f023fc..263ceed 100644
--- a/lib/concepts/Hash.ml
+++ b/lib/concepts/Hash.ml
@@ -2,13 +2,9 @@
type hash = Digestif.SHA256.t
-let size = 256/8
-
-let compare h1 h2 = Digestif.SHA256.unsafe_compare h1 h2
- |> Utilities.Ordering.of_int
-
+let size = 256 / 8
+let compare h1 h2 = Digestif.SHA256.unsafe_compare h1 h2 |> Utilities.Ordering.of_int
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 hash_of_int i =
@@ -17,15 +13,10 @@ let hash_of_int i =
hash_of_blob b
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
-
let to_hum_string hash = Digestif.SHA256.to_hex hash
-
let hash_equals = Digestif.SHA256.equal
let power_of_two p =