| Crates.io | jamhash |
| lib.rs | jamhash |
| version | 0.1.2 |
| created_at | 2026-01-07 09:55:42.205333+00 |
| updated_at | 2026-01-07 09:55:42.205333+00 |
| description | A fast, simple hash function with dual-path accumulation |
| homepage | |
| repository | https://github.com/St4NNi/jamhash |
| max_upload_size | |
| id | 2027925 |
| size | 293,811 |
A fast, non-cryptographic hash function designed for genomics and general-purpose hashing.
jamhash_u64: Optimized for hashing genomic k-mers encoded as u64 (2-bit encoding)jamhash_bytes: Size-optimized byte hashing with paths for short (≤16), medium (17-128), long (129-4095), and ultra-long (≥4KB) inputsJamHasher: Streaming hasher implementing std::hash::HasherThe jamhash_u64 function is specifically designed for bioinformatics workflows:
use jamhash::jamhash_u64;
// Hash a k-mer encoded as u64 (2-bit encoding: A=00, C=01, G=10, T=11)
let kmer: u64 = 0x00011011;
let hash = jamhash_u64(kmer);
use jamhash::{jamhash_bytes, JamHasher};
use std::hash::Hasher;
// Hash arbitrary bytes
let hash = jamhash_bytes(b"hello world");
// Streaming std::hash::Hasher implementation
let mut hasher = JamHasher::new();
hasher.write(b"hello ");
hasher.write(b"world");
let hash = hasher.finish();
Add to your Cargo.toml:
[dependencies]
jamhash = "0.1"
jamhash passes all 188 tests in SMHasher3, the comprehensive hash function test suite:
Overall result: pass (188 / 188 passed)
Full test results are available in smhasher3_jamhash.txt.
jamhash draws inspiration from:
Licensed under either of:
at your option.