MCPcopy Create free account
hub / github.com/Ruddle/Fomos / hash

Function hash

app_console/src/main.rs:159–164  ·  view source on GitHub ↗
(n: usize)

Source from the content-addressed store, hash-verified

157}
158
159fn hash(n: usize) -> usize {
160 // integer hash copied from Hugo Elias
161 let n = (n << 13) ^ n;
162 let n = n.wrapping_mul(n.wrapping_mul(n).wrapping_mul(15731) + 789221) + 1376312589;
163 n
164}
165
166fn hash2(x: usize) -> usize {
167 let mut x = ((x >> 16) ^ x) * 0x45d9f3b;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected