clean up
This commit is contained in:
parent
0b6f5e3db5
commit
53debfd866
11 changed files with 40 additions and 165 deletions
|
|
@ -1,4 +1,3 @@
|
|||
(* TODO use SHA512.of_raw_string_opt *)
|
||||
open Digestif
|
||||
|
||||
module type S = sig
|
||||
|
|
@ -20,7 +19,7 @@ module H32 = struct
|
|||
|
||||
let of_octets s =
|
||||
match SHA256.of_raw_string_opt s with
|
||||
| None -> Fmt.failwith "H32.of_octets failure: data is not 32 bytes"
|
||||
| None -> Fmt.failwith "H32.of_octets failure"
|
||||
| Some t -> t
|
||||
|
||||
let to_octets = SHA256.to_raw_string
|
||||
|
|
@ -50,7 +49,7 @@ module H64 = struct
|
|||
|
||||
let of_octets s =
|
||||
match SHA512.of_raw_string_opt s with
|
||||
| None -> Fmt.failwith "H64.of_octets failure: data is not 64 bytes"
|
||||
| None -> Fmt.failwith "H64.of_octets failure"
|
||||
| Some t -> t
|
||||
|
||||
let to_octets = SHA512.to_raw_string
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue