Skip to main content

compute_checksum

Function compute_checksum 

Source
pub fn compute_checksum(assignment: &[bool]) -> u64
Expand description

Computes an FNV-1a checksum for a boolean assignment.

FNV-1a (Fowler-Noll-Vo) is a fast, non-cryptographic hash function suitable for integrity verification. The implementation incorporates both the index and value to ensure position-sensitivity.

§Arguments

  • assignment - The boolean assignment to checksum

§Returns

A 64-bit FNV-1a hash of the assignment.

§Example

let checksum = compute_checksum(&[true, false, true]);
assert_ne!(checksum, 0);