diff options
| author | Marcos Magueta <maguetamarcos@gmail.com> | 2026-08-02 23:37:51 -0300 |
|---|---|---|
| committer | Estevan Castilho <tevo@riajuu.net> | 2026-08-23 03:06:53 +0000 |
| commit | 8d59f43f445164e8cc8bd3fe1a23bd04e807a6b3 (patch) | |
| tree | 6a673397f921070d8a86d026380548d5e251a29f /lib/concepts/Hash.ml | |
| parent | b762cb41da4d822416c3ab66940622882745fc0a (diff) | |
| download | RNT-8d59f43f445164e8cc8bd3fe1a23bd04e807a6b3.tar.gz RNT-8d59f43f445164e8cc8bd3fe1a23bd04e807a6b3.zip | |
format
Diffstat (limited to 'lib/concepts/Hash.ml')
| -rw-r--r-- | lib/concepts/Hash.ml | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/lib/concepts/Hash.ml b/lib/concepts/Hash.ml index aac7428..a84c60d 100644 --- a/lib/concepts/Hash.ml +++ b/lib/concepts/Hash.ml @@ -2,22 +2,16 @@ type hash = Digestif.SHA256.t -let size = 256/8 - -let compare h1 h2 = Digestif.SHA256.unsafe_compare h1 h2 - |> Ordering.of_int +let size = 256 / 8 +let compare h1 h2 = Digestif.SHA256.unsafe_compare h1 h2 |> Ordering.of_int let hash_of_value (v : Value.value) = Representation.(blob_of_value v |> bytes_of_blob) |> Digestif.SHA256.digest_bytes let hash_of_bytes bytes = Digestif.SHA256.digest_bytes bytes - let hash_of_blob blob = Representation.bytes_of_blob blob |> Digestif.SHA256.digest_bytes - let to_raw_string hash = Digestif.SHA256.to_raw_string hash - let of_raw_string str = Digestif.SHA256.of_raw_string str - let hash_equals = Digestif.SHA256.equal let bytes_of_hash (h : hash) = Bytes.of_string (Digestif.SHA256.to_raw_string h) |
