Permalink
Browse files

Add Bob Jenkins's SpookyHash to folly.

Summary:
http://burtleburtle.net/bob/hash/spooky.html
The code is in the public domain, so republishing it as such is fine.
The code needed modifications (the test was designed to run on Windows
only; removed unhygienic typedefs; moved to folly::hash namespace)

Also updated Makefile.am files.

Test Plan: test added

Reviewed By: soren@fb.com

FB internal diff: D549572
  • Loading branch information...
1 parent ce15293 commit ff25e3b55ba9380c0eb2bc2b3c6b6397e2ba663b @tudor tudor committed Aug 15, 2012
Showing with 1,225 additions and 1 deletion.
  1. +2 −0 folly/Hash.h
  2. +3 −1 folly/Makefile.am
  3. +374 −0 folly/SpookyHash.cpp
  4. +304 −0 folly/SpookyHash.h
  5. +12 −0 folly/test/Makefile.am
  6. +530 −0 folly/test/SpookyHashTest.cpp
View
@@ -22,6 +22,8 @@
#include <string>
#include <utility>
+#include "folly/SpookyHash.h"
+
/*
* Various hashing functions.
*/
View
@@ -66,6 +66,7 @@ nobase_follyinclude_HEADERS = \
SmallLocks.h \
small_vector.h \
sorted_vector_types.h \
+ SpookyHash.h \
StlAllocator.h \
String.h \
String-inl.h \
@@ -106,7 +107,8 @@ libfolly_la_SOURCES = \
Format.cpp \
FormatTables.cpp \
String.cpp \
- Bits.cpp
+ Bits.cpp \
+ SpookyHash.cpp
libfolly_la_LIBADD = $(BOOST_THREAD_LIB) -lpthread
Oops, something went wrong.

0 comments on commit ff25e3b

Please sign in to comment.