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
Is it possible to implement Hash on the hashmap or hashset?
I know that rust stdlib doesn't do this for security reasons. See rust-lang/rust#21182
But as it seems like the goal of this library isn't as focused on security (y'all are using fxhash) as much the stdlib HashSet is, that shouldn't be an issue.
The text was updated successfully, but these errors were encountered:
Unfortunately this is not possible because the ordering of the elements in a HashMap is non-deterministic but the hash value depends on the ordering. This means that two HashMaps with the same contents may have different hashes because the elements are in a different order internally.
Actually, you can use a commutative operator to put together the hash of the hashmap given the hashes of the keys and values. I know that other languages do this, so it's definitely not impossible.
Would you like me to give an example implementation? rust-lang/rust#21182 (comment)
For those not concerned with DDoS attacks with our hashmaps and hashsets, security concerns aren't an issue at all. Of course, mixing for hashmaps will be a bit problematic as you have to choose to hash or not hash the values.
Is it possible to implement Hash on the hashmap or hashset?
I know that rust stdlib doesn't do this for security reasons. See rust-lang/rust#21182
But as it seems like the goal of this library isn't as focused on security (y'all are using fxhash) as much the stdlib HashSet is, that shouldn't be an issue.
The text was updated successfully, but these errors were encountered: