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

Function hash_key

nodedb/src/engine/kv/hash_helpers.rs:45–50  ·  view source on GitHub ↗

Compute the hash for a key using the FxHash algorithm.

(key: &[u8])

Source from the content-addressed store, hash-verified

43
44/// Compute the hash for a key using the FxHash algorithm.
45pub(super) fn hash_key(key: &[u8]) -> u64 {
46 let hasher_builder = FxBuildHasher;
47 let mut h = hasher_builder.build_hasher();
48 h.write(key);
49 h.finish()
50}
51
52/// Compute FxHash over multiple byte slices concatenated.
53///

Callers 6

get_with_surrogateMethod · 0.85
get_entry_metaMethod · 0.85
putMethod · 0.85
deleteMethod · 0.85
reap_expiredMethod · 0.85
set_expireMethod · 0.85

Calls 3

build_hasherMethod · 0.80
writeMethod · 0.45
finishMethod · 0.45

Tested by

no test coverage detected