[+] Integer hash function
This commit is contained in:
@@ -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
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user