Skip to main content

Module ChecksumUtil

Module ChecksumUtil 

Source
Expand description

Standalone checksum calculation helpers for update integrity verification.

These free functions mirror the private methods on UpdateManager so the same hashing logic can be unit-tested without constructing a full manager and can be reused by other modules (e.g. Downloader) without cross-crate duplication.

Functionsยง

crc32_hex
CRC-32 hex digest of data (8 hex digits, zero-padded).
md5_hex
MD5 hex digest of data.
sha256_file
SHA-256 hex digest of a file at path.
sha256_hex
SHA-256 hex digest of data.
sha512_hex
SHA-512 hex digest of data.
verify
Verify data against an expected hex digest using the named algorithm. Supported algorithms: sha256, sha512, md5, crc32. Returns true on match, false on mismatch or unknown algorithm.