Add a dedicated length-prefixing method to Hasher

This accomplishes two main goals:
- Make it clear who is responsible for prefix-freedom, including how they should do it
- Make it feasible for a `Hasher` that *doesn't* care about Hash-DoS resistance to get better performance by not hashing lengths

This does not change rustc-hash, since that's in an external crate, but that could potentially use it in future.
This commit is contained in:
Scott McMurray 2022-03-04 00:17:26 -08:00
parent 086bf7a8ff
commit 98054377ee
14 changed files with 166 additions and 6 deletions

View file

@ -18,6 +18,7 @@
#![feature(generators)]
#![feature(let_else)]
#![feature(hash_raw_entry)]
#![feature(hasher_prefixfree_extras)]
#![feature(maybe_uninit_uninit_array)]
#![feature(min_specialization)]
#![feature(never_type)]