diff --git a/tngame-rs/src/utils.rs b/tngame-rs/src/utils.rs new file mode 100644 index 0000000..55830e1 --- /dev/null +++ b/tngame-rs/src/utils.rs @@ -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 +} \ No newline at end of file