aboutsummaryrefslogtreecommitdiffstats
path: root/lib/concepts/Hash.ml
blob: 106e731b4a83b3e34c6d80d1e6c99969120db3fe (plain) (blame)
1
2
3
4
5
6
7
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)