24 {
25
27 FL_DISABLE_WARNING_IMPLICIT_FALLTHROUGH;
28
30 const int nblocks = int(len / 4);
31
32 u32 h1 = seed;
33 const u32 c1 = 0xcc9e2d51;
34 const u32 c2 = 0x1b873593;
35
36
37 const u32 *blocks = reinterpret_cast<const u32 *>(data);
38 for (int i = 0; i < nblocks; ++i) {
39 u32 k1 = blocks[i];
40 k1 *= c1;
41 k1 = (k1 << 15) | (k1 >> 17);
42 k1 *= c2;
43
44 h1 ^= k1;
45 h1 = (h1 << 13) | (h1 >> 19);
46 h1 = h1 * 5 + 0xe6546b64;
47 }
48
49
50 const fl::u8 *tail = data + (nblocks * 4);
51 u32 k1 = 0;
52 switch (len & 3) {
53 case 3:
54 k1 ^= u32(tail[2]) << 16;
55 case 2:
56 k1 ^= u32(tail[1]) << 8;
57 case 1:
58 k1 ^= u32(tail[0]);
59 k1 *= c1;
60 k1 = (k1 << 15) | (k1 >> 17);
61 k1 *= c2;
62 h1 ^= k1;
63 }
64
65
66 h1 ^= u32(len);
67
68 h1 ^= h1 >> 16;
69 h1 *= 0x85ebca6b;
70 h1 ^= h1 >> 13;
71 h1 *= 0xc2b2ae35;
72 h1 ^= h1 >> 16;
73
74 return h1;
75
77}
#define FL_DISABLE_WARNING_PUSH
#define FL_DISABLE_WARNING_POP