| Crates.io | ez-hash |
| lib.rs | ez-hash |
| version | 1.1.0 |
| created_at | 2025-12-18 03:31:21.740116+00 |
| updated_at | 2025-12-20 11:14:35.866311+00 |
| description | Ergonomic hashing helpers with a simple Hashable API and optional algorithm features. |
| homepage | https://github.com/kvinwang/ez-hash |
| repository | https://github.com/kvinwang/ez-hash |
| max_upload_size | |
| id | 1991636 |
| size | 31,045 |
Ergonomic hashing helpers for Rust.
Hashable.[dependencies]
ez-hash = "1.0"
To enable only selected algorithms:
ez-hash = { version = "1.0", default-features = false, features = ["sha2", "sha3"] }
Single-part:
use ez_hash::sha256;
let digest = sha256("hello");
Multi-part (tuple / array / vec):
use ez_hash::{keccak256, sha256};
let a = sha256(("a", "bc"));
let b = sha256(["a", "b", "c"]);
let c = keccak256(("prefix", "data", "suffix"));
assert_eq!(a, b);
Bytes:
use ez_hash::sha256;
let bytes = 1u32.to_le_bytes();
let digest = sha256(bytes);
The crate exposes:
Hashable trait (implemented for common byte/string types and for tuples/arrays/vectors of hashables)Hash functions (availability depends on enabled features):
sha1sha224, sha256, sha384, sha512, sha512_224, sha512_256sha3_224, sha3_256, sha3_384, sha3_512keccak256, keccak512blake2b_256, blake2b_384, blake2b_512, blake2s_128, blake2s_256blake3md5Licensed under the Apache License, Version 2.0. See LICENSE.