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

Function crc32

crates/stdlib/src/binascii.rs:200–208  ·  view source on GitHub ↗
(data: ArgBytesLike, init: OptionalArg<PyIntRef>)

Source from the content-addressed store, hash-verified

198
199 #[pyfunction]
200 pub(crate) fn crc32(data: ArgBytesLike, init: OptionalArg<PyIntRef>) -> u32 {
201 let init = init.map_or(0, |i| i.as_u32_mask());
202
203 let mut hasher = crc32fast::Hasher::new_with_initial(init);
204 data.with_ref(|bytes| {
205 hasher.update(bytes);
206 hasher.finalize()
207 })
208 }
209
210 #[pyfunction]
211 pub(crate) fn crc_hqx(data: ArgBytesLike, init: PyIntRef) -> u32 {

Callers

nothing calls this directly

Calls 4

as_u32_maskMethod · 0.80
with_refMethod · 0.80
updateMethod · 0.45
finalizeMethod · 0.45

Tested by

no test coverage detected