MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / short_hex

Function short_hex

src/redundancy.rs:454–462  ·  view source on GitHub ↗
(bytes: &[u8])

Source from the content-addressed store, hash-verified

452// ---------------------------------------------------------------------------
453
454fn short_hex(bytes: &[u8]) -> String {
455 // 16 hex chars = 64 bits of entropy — enough to make a collision
456 // between two functions in the same repo astronomically unlikely.
457 let mut s = String::with_capacity(16);
458 for b in bytes.iter().take(8) {
459 let _ = write!(s, "{b:02x}");
460 }
461 s
462}
463
464fn short_sha256(s: &str) -> String {
465 let mut h = Sha256::new();

Callers 3

hash_kind_walkFunction · 0.85
hash_call_sequenceFunction · 0.85
short_sha256Function · 0.85

Calls 1

takeMethod · 0.45

Tested by

no test coverage detected