Feature gate: #![feature(hasher_prefixfree_extras)]
This is a tracking issue for the new provided methods on Hasher
added to fix #94026
write_str
lets the hasher customize how it works with str
, so it can use the b'\xFF'
trick if it's byte-wise, or a different approach if it does chunked rounds.write_length_prefix
gives an obvious choice when implementing Hash
for collections (like VecDeque
) which can't just use the slice hash, and allows the hasher to optimize how best to represent the length.// core::hash pub trait Hasher { // ... existing stuff ... fn write_length_prefix(&mut self, len: usize); fn write_str(&mut self, s: &str); }Steps / History
Hasher
#94598write_str
provided implementation be? It was added matching the previous impl Hash for str
behaviour to get in without breaking hash checks (like the one in cargo
), but that's not always prefix-free (it depends on the round strategy), so there's an argument that a different implementation would be better.RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4