mirage / digestif

Simple hash algorithms in OCaml

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add `to_raw_bytes`

dinosaure opened this issue · comments

In some context, it can be useful to get the hash as a bytes instead of a string. It's an outcome of digestif, so the user is responsible about this bytes. It permits to not use Bytes.unsafe_to_string in this context.

Also, add a into_raw_bytes (or a similar name), something that has: val encode_into : t -> bytes * int -> unit where nothing is allocated, but the hash value is written into the buffer passed into (at the specified offset) //cc @reynir