Skip to main content

luaur_bytecode/methods/
bc_inst_hash_mix_bytecode_graph.rs

1use crate::records::bc_inst_hash::BcInstHash;
2
3impl BcInstHash {
4    pub fn mix_u32_u32(mut h: u32, mut k: u32) -> u32 {
5        // MurmurHash2 step
6        k = k.wrapping_mul(Self::M);
7        k ^= k >> Self::R;
8        k = k.wrapping_mul(Self::M);
9
10        h = h.wrapping_mul(Self::M);
11        h ^= k;
12
13        h
14    }
15}