MCPcopy Create free account
hub / github.com/aeroxy/chrome-devtools-cli / simple_hash

Function simple_hash

src/friendly.rs:22–28  ·  view source on GitHub ↗

Simple hash of a string to a u64.

(s: &str)

Source from the content-addressed store, hash-verified

20
21/// Simple hash of a string to a u64.
22fn simple_hash(s: &str) -> u64 {
23 let mut h: u64 = 5381;
24 for b in s.bytes() {
25 h = h.wrapping_mul(33).wrapping_add(b as u64);
26 }
27 h
28}
29
30/// Convert a target ID to a friendly "adjective-noun" name.
31pub fn to_friendly(target_id: &str) -> String {

Callers 1

to_friendlyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected