[+] Integer hash function

This commit is contained in:
Azalea Gui
2023-03-09 01:35:41 -05:00
parent 34994da62a
commit 345a9932ec
+8
View File
@@ -0,0 +1,8 @@
// Integer hashing
pub fn hash(mut x: u32) -> u32 {
x = ((x >> 16) ^ x).wrapping_mul(0x45d9f3b);
x = ((x >> 16) ^ x).wrapping_mul(0x45d9f3b);
x = (x >> 16) ^ x;
x
}