You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This uses the phf* (perfect hash function) crates underneath, and if I understand correctly, phf offers guaranteed perfect, no collision, hash values for a compile time aggregated (static) set.
However as implemented here, these u64 hashes are shift-xor'd to u32 values:
Does this not reintroduce a risk of collision? Or does string_cache_codegen also include a guaruntee that the u32-bit hash doesn't collide for a static set? Or does string_cache not really need to care about such collisions?
Depending on the answer, I might be able to offer a doc PR.
The text was updated successfully, but these errors were encountered:
This uses the phf* (perfect hash function) crates underneath, and if I understand correctly, phf offers guaranteed perfect, no collision, hash values for a compile time aggregated (static) set.
However as implemented here, these u64 hashes are shift-xor'd to u32 values:
string-cache/src/atom.rs
Line 259 in 51b58ce
Does this not reintroduce a risk of collision? Or does string_cache_codegen also include a guaruntee that the u32-bit hash doesn't collide for a static set? Or does string_cache not really need to care about such collisions?
Depending on the answer, I might be able to offer a doc PR.
The text was updated successfully, but these errors were encountered: