4 ms·
The Rust HashMap and HashSet implementations are generic over hasher: you can pick a faster one if you don't have to worry about getting ddos'd. Last I checked,
by palmtree3000 8y ago
The Rust HashMap and HashSet implementations are generic over hasher: you can pick a faster one if you don't have to worry about getting ddos'd. Last I checked, the go-to fast hasher was fnv: https://doc.servo.org/fnv/ https://doc.servo.org/fnv/
- steveklabnik 8y agoYup, this is 100% correct.
- petre 8y agoWell, it's not in the standard lib and I couldn't get my program to compile. Compare that to D or Go, where you don't have to fight the copiler.
- steveklabnik 8y agoRust has a different take on the standard library than many other languages. It's kept quite minimal, because it's trivial to use a package.
- petre 8y agoIs there any way to use it directly in the source w/o having to create a Crate.toml and src dirs? Is there a getting started document? Dub recently included such a feature.
- steveklabnik 8y agoThat's the hard way. `cargo new` generates both for you, so you don't need to do any of that stuff manually. If you really, really want to, you could use https://crates.io/crates/cargo-script https://crates.io/crates/cargo-script to do the way you're talking about. https://doc.rust-lang.org/cargo/ https://doc.rust-lang.org/cargo/ has installation, getting started, a reference, all of that. It needs some work, but for the basics of doing this, it's got it all.
- rurban 8y agoHow often do I need to explain that this siphash claim of DDOS protection is utter nonsense. siphash can easily be brute forced like every insecure hash function (<256 bits), and proper DDOS protection can only be provided by a proper collision strategy. Even DJB himself does so.