| Crates.io | hasherkawpow-sys |
| lib.rs | hasherkawpow-sys |
| version | 0.1.0 |
| created_at | 2025-09-04 03:15:33.748017+00 |
| updated_at | 2025-09-04 03:15:33.748017+00 |
| description | Low-level Rust bindings for KawPow hashing and verification. |
| homepage | https://github.com/vpalmerio/hasherkawpow-sys |
| repository | https://github.com/vpalmerio/hasherkawpow-sys |
| max_upload_size | |
| id | 1823571 |
| size | 189,777 |
Low-level Rust bindings for KawPow hashing and verification.
This crate provides two functions:
hash_kawpow — compute a KawPow hash from a header hash, nonce, and block height.verify_kawpow — verify a previously computed KawPow hash.These functions wrap FFI calls to native implementations via unsafe code,
but expose a safe Rust API with fixed-size arrays.
The underlying C source code is from
MintPond's hasher-kawpow library,
which itself adapts most of its native code from the
Ravencoin project.
use hasherkawpow_sys::{hash_kawpow, verify_kawpow};
let header_hash = [0u8; 32];
let nonce: u64 = 42;
let block_height = 100;
// Compute a hash
let (mix, hash) = hash_kawpow(&header_hash, &nonce, block_height);
// Verify the hash
assert!(verify_kawpow(&header_hash, &nonce, block_height, &mix, &hash));
Run tests with cargo test -- --test-threads=1. cargo test will occasionally fail at src/ethash/progpow.cpp:190