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

Function adler32

crates/stdlib/src/zlib.rs:66–74  ·  view source on GitHub ↗
(data: ArgBytesLike, begin_state: OptionalArg<PyIntRef>)

Source from the content-addressed store, hash-verified

64
65 #[pyfunction]
66 fn adler32(data: ArgBytesLike, begin_state: OptionalArg<PyIntRef>) -> u32 {
67 data.with_ref(|data| {
68 let begin_state = begin_state.map_or(1, |i| i.as_u32_mask());
69
70 let mut hasher = Adler32::from_value(begin_state);
71 hasher.update_buffer(data);
72 hasher.hash()
73 })
74 }
75
76 #[pyfunction]
77 fn crc32(data: ArgBytesLike, begin_state: OptionalArg<PyIntRef>) -> u32 {

Callers

nothing calls this directly

Calls 3

with_refMethod · 0.80
as_u32_maskMethod · 0.80
hashMethod · 0.45

Tested by

no test coverage detected