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

Function hash_same_bytes_same_hash

nodedb-query/src/msgpack_scan/compare.rs:182–188  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

180
181 #[test]
182 fn hash_same_bytes_same_hash() {
183 let buf = encode(&json!(42));
184 let state = std::collections::hash_map::RandomState::new();
185 let h1 = hash_field_bytes_with(&buf, val_range(&buf), &state);
186 let h2 = hash_field_bytes_with(&buf, val_range(&buf), &state);
187 assert_eq!(h1, h2);
188 }
189
190 #[test]
191 fn hash_different_values_likely_differ() {

Callers

nothing calls this directly

Calls 3

hash_field_bytes_withFunction · 0.85
val_rangeFunction · 0.85
encodeFunction · 0.70

Tested by

no test coverage detected