| Crates.io | farmhash-sys |
| lib.rs | farmhash-sys |
| version | 0.1.0 |
| created_at | 2025-04-04 03:30:38.892194+00 |
| updated_at | 2025-04-04 03:30:38.892194+00 |
| description | Rust FFI bindings for a minimal implementation of Google's FarmHash hashing algorithms |
| homepage | |
| repository | https://github.com/cmackenzie1/simplehash/farmhash-sys |
| max_upload_size | |
| id | 1619369 |
| size | 26,848 |
Rust FFI bindings for a minimal implementation of Google's FarmHash hashing algorithms.
This crate provides low-level Rust bindings to a minimal implementation of Google's FarmHash algorithm. FarmHash is a family of hash functions designed for fast hashing of strings and other data.
The implementation is simplified and optimized for simplicity and ease of use, while still providing the core FarmHash functions:
hash32 - 32-bit hashhash32_with_seed - 32-bit hash with seedhash64 - 64-bit hashhash64_with_seed - 64-bit hash with seedhash64_with_seeds - 64-bit hash with two seedsfingerprint128 - 128-bit fingerprintfingerprint128_with_seed - 128-bit fingerprint with seedAdd this to your Cargo.toml:
[dependencies]
farmhash-sys = "0.1.0"
Example:
use farmhash_sys::farmhash;
fn main() {
let data = b"hello world";
// 32-bit hash
let hash32 = farmhash::hash32(data);
println!("32-bit hash: {}", hash32);
// 64-bit hash
let hash64 = farmhash::hash64(data);
println!("64-bit hash: {}", hash64);
// 128-bit fingerprint
let (low, high) = farmhash::fingerprint128(data);
println!("128-bit fingerprint: ({}, {})", low, high);
}
This project is licensed under the MIT License - see the LICENSE file for details.
This is a simplified implementation based on Google's FarmHash algorithm.