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

Method hash

crates/vm/src/stdlib/_sre.rs:518–525  ·  view source on GitHub ↗
(zelf: &crate::Py<Self>, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

516
517 impl Hashable for Pattern {
518 fn hash(zelf: &crate::Py<Self>, vm: &VirtualMachine) -> PyResult<PyHash> {
519 let hash = zelf.pattern.hash(vm)?;
520 let (_, code, _) = unsafe { zelf.code.align_to::<u8>() };
521 let hash = hash ^ vm.state.hash_secret.hash_bytes(code);
522 let hash = hash ^ (zelf.flags.bits() as PyHash);
523 let hash = hash ^ (zelf.isbytes as i64);
524 Ok(hash)
525 }
526 }
527
528 impl Comparable for Pattern {

Callers 2

hashFunction · 0.45
thread_to_rust_idFunction · 0.45

Calls 1

hash_bytesMethod · 0.80

Tested by

no test coverage detected