Closed jhwgh1968 closed 3 years ago
Hi, and thank you!
The with_init
prefix is a bit counterintuitive, considering the fact that regular functions use the new
prefix.
Maybe new_with_seed()
and new_for_fp_rate_with_seed()
?
Also instead of accepting two u64
, which is the internal representation, but not very convenient, maybe accept 16 bytes and decode them as little endian? That would be easier from a user perspective.
Just as an explanation, I thought new
and with_init
was logical based on Vec's new
and with_capacity
. But I suppose "init" is less descriptive in retrospect.
Still, your version looks good. Thanks!
This PR places the crate's requirement on the
rand
behind a feature gate, so that it can be supported on bare-metal embedded and WebAssembly platforms. (Random generation is of course enabled by default.)To achieve this, it adds two functions to create SIP hashers with provided initial state, rather than randomly generating it.