Open
Description
With sufficiently expressive associated constants (including rust-lang/rust#34344), it would be nice to provide scaffolding for secure hashing without allocation by extending Hasher
like:
pub trait Hasher {
const DigestSize: usize = 8;
/// Completes a round of hashing, producing the untruncated output hash generated.
fn untruncated_finish(&self) -> [u8; Self::DigestSize] {
self.finish()
}
...
}
[I think specialization might also be required to write that default method; I forget what syntax is needed.]