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

Function hash_bigint

crates/common/src/hash.rs:133–142  ·  view source on GitHub ↗
(value: &BigInt)

Source from the content-addressed store, hash-verified

131}
132
133pub fn hash_bigint(value: &BigInt) -> PyHash {
134 let ret = match value.to_i64() {
135 Some(i) => mod_int(i),
136 None => (value % MODULUS).to_i64().unwrap_or_else(|| unsafe {
137 // SAFETY: MODULUS < i64::MAX, so value % MODULUS is guaranteed to be in the range of i64
138 core::hint::unreachable_unchecked()
139 }),
140 };
141 fix_sentinel(ret)
142}
143
144#[inline]
145pub const fn hash_usize(data: usize) -> PyHash {

Callers 2

hash_wrapperFunction · 0.85
hashMethod · 0.85

Calls 2

mod_intFunction · 0.85
fix_sentinelFunction · 0.85

Tested by

no test coverage detected