MCPcopy Create free account
hub / github.com/cosdata/cosdata / custom_bit_mapping

Method custom_bit_mapping

org/src/performant_fixed_set.rs:21–28  ·  view source on GitHub ↗
(&self, value: u32)

Source from the content-addressed store, hash-verified

19 }
20
21 fn custom_bit_mapping(&self, value: u32) -> u8 {
22 let mut hash = value;
23 hash = hash.wrapping_mul(0x5bd1e995);
24 hash ^= hash >> 15;
25 hash = hash.wrapping_mul(0x5bd1e995);
26
27 (hash % 128) as u8
28 }
29
30 fn insert(&mut self, value: u32) {
31 let index = self.get_bucket_index(value);

Callers 2

insertMethod · 0.80
is_memberMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected