aboutsummaryrefslogblamecommitdiffstats
path: root/lib/concepts/Hash.ml
blob: f467ee78588bcf3b8e3e552bb0e03c47b05cbb69 (plain) (tree)
1
2
3
4
5
6
7
8
9

                  
                             
 




                                                                                   
(* @needs Value *)

type hash = Digestif.SHA256.t

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)