smchash
High-performance hash function passing all 188 SMHasher3 quality tests.
Features
- Fast: Passes all 188 SMHasher3 quality tests
no_stdcompatible: Works in embedded environments- Built-in PRNG:
smc_rand()passes BigCrush and PractRand - Cache-friendly: Processes 128 bytes (2 cache lines) per iteration
Usage
use ;
// Basic hashing
let hash = smchash;
// Seeded hashing
let hash = smchash_seeded;
// PRNG (passes BigCrush/PractRand)
let mut seed = 42u64;
let random = smc_rand;
API
smchash(data: &[u8]) -> u64- Hash with default seedsmchash_seeded(data: &[u8], seed: u64) -> u64- Hash with custom seedsmchash_secret(data: &[u8], seed: u64, secret: &[u64; 9]) -> u64- Hash with custom secretssmc_rand(seed: &mut u64) -> u64- PRNG
Performance
- 128-bit MUM (Multiply-XOR-Mix) construction
- 8 parallel lanes for maximum ILP on ARM64
- Secrets are odd, prime, 32 bits set, pairwise hamming distance = 32
License
MIT License - Copyright 2025 ScaleCode Solutions