News for hackers. Stuff that matters.
Re:Rust vs C Pitfalls by anoonmoose on Tuesday December 27, 2016 @10:40PM (#13268268)
I believe that what your OP mmstick might have been saying is that the hashing algorithm used in the C version of the algorithm might be very different from the hashing algorithm in the Rust version, and this difference might be significant.

I don't speak Rust, so I can't quite tell what's going on here:

http://benchmarksgame.alioth.debian.org/u64q/program.php?tes...

But the C hash function is very simple, and probably not at all collision-resistant:

  #define CUSTOM_HASH_FUNCTION(key) (khint32_t)((key) ^ (key)>>7)
Again, I don't speak Rust so hopefully someone can comment on this, but I don't see that same simple hash is being used in the Rust...I think it might be using a default hash function, which would probably be more collision resistant.

I am sure that the Rust could be made to do the same thing, but I am not sure that, as-is, this is an apples to apples comparison.

Re:Rust vs C Pitfalls by Manishearth on Tuesday December 27, 2016 @11:18PM (#13268392)
llogiq wrote a post about this: https://llogiq.github.io/2016/12/08/hash.html