Function pw_tokenizer_core::hash_bytes_fixed
source · pub const fn hash_bytes_fixed(bytes: &[u8], len: usize) -> u32
Expand description
Calculate the hash for a sequence of bytes, examining at most len
bytes.
use pw_tokenizer_core::hash_bytes_fixed;
let hash = hash_bytes_fixed(&[0x34, 0xd8, 0x3a, 0xbb, 0xf1, 0x0e, 0x07], 4);
assert_eq!(hash, 0x92c5d2ac);