Add fnv hash

Signed-off-by: Jens Axboe <axboe@fb.com>
diff --git a/crc/fnv.c b/crc/fnv.c
new file mode 100644
index 0000000..04c0560
--- /dev/null
+++ b/crc/fnv.c
@@ -0,0 +1,16 @@
+#include "fnv.h"
+
+#define FNV_PRIME	0x100000001b3ULL
+
+uint64_t fnv(const void *buf, uint32_t len, uint64_t hval)
+{
+	const uint64_t *ptr = buf;
+	const uint64_t *end = (void *) buf + len;
+
+	while (ptr < end) {
+		hval *= FNV_PRIME;
+		hval ^= (uint64_t) *ptr++;
+	}
+
+	return hval;
+}