Skip to main content

detect_algorithm

Function detect_algorithm 

Source
pub fn detect_algorithm(
    page_data: &[u8],
    page_size: u32,
    vendor_info: Option<&VendorInfo>,
) -> ChecksumAlgorithm
Expand description

Detect the checksum algorithm in use for a page.

Mirrors the logic of validate_checksum() but returns the detected algorithm instead of a full validation result. Returns None for empty/zero pages and BUF_NO_CHECKSUM_MAGIC pages.