(data: ArgBytesLike, init: OptionalArg<PyIntRef>)
| 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 { |
nothing calls this directly
no test coverage detected