X-Git-Url: https://jfr.im/git/irc/rqf/shadowircd.git/blobdiff_plain/9802490cbbdd66a932dfc455d13c4178a39d4a24..91e46e62e5f9faf6735e0c41ce21113939cacb85:/src/hash.c diff --git a/src/hash.c b/src/hash.c index 6f2bd65..9ff4b12 100644 --- a/src/hash.c +++ b/src/hash.c @@ -109,7 +109,8 @@ fnv_hash_upper(const unsigned char *s, int bits) h ^= ToUpper(*s++); h += (h<<1) + (h<<4) + (h<<7) + (h << 8) + (h << 24); } - h = (h >> bits) ^ (h & ((2^bits)-1)); + if (bits < 32) + h = ((h >> bits) ^ h) & ((1<> bits) ^ (h & ((2^bits)-1)); + if (bits < 32) + h = ((h >> bits) ^ h) & ((1<> bits) ^ (h & ((2^bits)-1)); + if (bits < 32) + h = ((h >> bits) ^ h) & ((1<> bits) ^ (h & ((2^bits)-1)); + if (bits < 32) + h = ((h >> bits) ^ h) & ((1<