From 9a74622ca1994669cdb3bac0bb2f6df2febd2744 Mon Sep 17 00:00:00 2001 From: Jan Moskyto Matejka Date: Wed, 10 Feb 2016 13:26:07 +0100 Subject: Updated RTA hashes to 32-bit values. ... and reworked the hashes a bit. Also added mem_hash function which just computes a hash of given memory block. --- lib/hash.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'lib/hash.h') diff --git a/lib/hash.h b/lib/hash.h index a73f647a..f4a953a3 100644 --- a/lib/hash.h +++ b/lib/hash.h @@ -178,3 +178,15 @@ #define HASH_WALK_FILTER_END } while (0) +static inline uint +mem_hash(void *p, int s) +{ + const char *pp = p; + const u64 multiplier = 0xb38bc09a61202731ULL; + u64 value = 0x001047d54778bcafULL; + for (int i=0;i> 32) ^ (value & 0xffffffff)); +} + -- cgit v1.2.3