Add SpookyHashV2
Summary: SpookyHashV2 is backwards incompatible with V1. I renamed the existing SpookyHash class to SpookyHashV1 (and fixed all uses); the new class is called SpookyHashV2. From http://burtleburtle.net/bob/hash/spooky.html: Both V1 and V2 pass all the tests. V2 corrects two oversights in V1: In the short hash, there was a d = length that should have been d += length, which means some entropy got dropped on the floor. It passed the tests anyhow, but fixing this probably means more distinct info from the message makes it into the result. The long hash always ended in mix()+end(), but only end() was needed. Removing the extra call to mix() makes all long hashes faster by a small constant amount. Test Plan: test added; unicorn compiles Reviewed By: andrei.alexandrescu@fb.com FB internal diff: D597173
Showing
folly/SpookyHashV1.cpp
0 → 100644
folly/SpookyHashV1.h
0 → 100644
This diff is collapsed.
folly/SpookyHashV2.cpp
0 → 100644
folly/SpookyHashV2.h
0 → 100644
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Please register or sign in to comment