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

Method generate_hash

crates/stdlib/src/contextvars.rs:361–365  ·  view source on GitHub ↗
(zelf: &Py<Self>, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

359 }
360
361 fn generate_hash(zelf: &Py<Self>, vm: &VirtualMachine) -> PyHash {
362 let name_hash = vm.state.hash_secret.hash_str(&zelf.name);
363 let pointer_hash = crate::common::hash::hash_pointer(zelf.as_object().get_id());
364 pointer_hash ^ name_hash
365 }
366 }
367
368 #[pyclass(with(Constructor, Hashable, Representable))]

Callers

nothing calls this directly

Calls 4

hash_pointerFunction · 0.85
hash_strMethod · 0.80
get_idMethod · 0.45
as_objectMethod · 0.45

Tested by

no test coverage detected