-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Open
Labels
T-libs-apiRelevant to the library API team, which will review and decide on the RFC.Relevant to the library API team, which will review and decide on the RFC.
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.]
Metadata
Metadata
Assignees
Labels
T-libs-apiRelevant to the library API team, which will review and decide on the RFC.Relevant to the library API team, which will review and decide on the RFC.