Lines Matching refs:hash
1 // From http://www.azillionmonkeys.com/qed/hash.html
3 #include "net/disk_cache/hash.h"
22 uint32_t hash = len, tmp;
33 hash += get16bits(data);
34 tmp = (get16bits(data + 2) << 11) ^ hash;
35 hash = (hash << 16) ^ tmp;
37 hash += hash >> 11;
42 case 3: hash += get16bits(data);
43 hash ^= hash << 16;
44 hash ^= data[sizeof(uint16_t)] << 18;
45 hash += hash >> 11;
47 case 2: hash += get16bits(data);
48 hash ^= hash << 11;
49 hash += hash >> 17;
51 case 1: hash += *data;
52 hash ^= hash << 10;
53 hash += hash >> 1;
57 hash ^= hash << 3;
58 hash += hash >> 5;
59 hash ^= hash << 4;
60 hash += hash >> 17;
61 hash ^= hash << 25;
62 hash += hash >> 6;
64 return hash;