MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / surrogate_for

Function surrogate_for

nodedb/tests/executor_tests/test_array_ops.rs:10–17  ·  view source on GitHub ↗
(id: &str)

Source from the content-addressed store, hash-verified

8use crate::helpers::*;
9
10fn surrogate_for(id: &str) -> nodedb_types::Surrogate {
11 let mut h: u32 = 2_166_136_261;
12 for &b in id.as_bytes() {
13 h ^= b as u32;
14 h = h.wrapping_mul(16_777_619);
15 }
16 nodedb_types::Surrogate::new(h.max(1))
17}
18
19fn insert_product(
20 core: &mut nodedb::data::executor::core_loop::CoreLoop,

Callers 1

insert_productFunction · 0.70

Calls 1

as_bytesMethod · 0.45

Tested by

no test coverage detected