MCPcopy Index your code
hub / github.com/RustPython/RustPython / source_hash

Function source_hash

crates/vm/src/stdlib/_imp.rs:342–345  ·  view source on GitHub ↗
(key: u64, source: PyBytesRef)

Source from the content-addressed store, hash-verified

340
341 #[pyfunction]
342 fn source_hash(key: u64, source: PyBytesRef) -> Vec<u8> {
343 let hash: u64 = crate::common::hash::keyed_hash(key, source.as_bytes());
344 hash.to_le_bytes().to_vec()
345 }
346}
347
348fn update_code_filenames(

Callers

nothing calls this directly

Calls 3

keyed_hashFunction · 0.85
to_vecMethod · 0.80
as_bytesMethod · 0.45

Tested by

no test coverage detected