| Crates.io | waddling-errors-hash |
| lib.rs | waddling-errors-hash |
| version | 0.7.3 |
| created_at | 2025-11-20 17:47:08.580164+00 |
| updated_at | 2026-01-20 08:01:11.002502+00 |
| description | Compact xxHash3-based error code hashing for network-efficient diagnostics in distributed systems |
| homepage | |
| repository | https://gitlab.com/AshutoshMahala/waddling-errors |
| max_upload_size | |
| id | 1942312 |
| size | 93,813 |
WDP-compliant xxHash3 computation for diagnostic codes.
Converts error codes to compact 5-character hashes per WDP Part 5.
use waddling_errors_hash::compute_wdp_hash;
let hash = compute_wdp_hash("E.Auth.Token.001");
// Returns 5-char base62 hash, e.g., "V6a0B"
// Case-insensitive (WDP normalization):
assert_eq!(
compute_wdp_hash("E.Auth.Token.001"),
compute_wdp_hash("e.auth.token.001")
);
[dependencies]
waddling-errors-hash = "0.7"
use waddling_errors_hash::{
compute_wdp_hash, // Hash error code
compute_wdp_namespace_hash, // Hash namespace
compute_wdp_full_id, // "ns_hash-code_hash"
};
let code_hash = compute_wdp_hash("E.Auth.Token.001"); // "V6a0B"
let ns_hash = compute_wdp_namespace_hash("auth_lib"); // "05o5h"
let full_id = compute_wdp_full_id("auth_lib", "E.Auth.Token.001"); // "05o5h-V6a0B"
use waddling_errors_hash::{compute_hash_with_config, HashConfig};
let config = HashConfig::with_seed(0x1234567890ABCDEF);
let hash = compute_hash_with_config("E.Auth.Token.001", &config);
| Purpose | Seed | u64 Value |
|---|---|---|
| Error codes | "wdp-v1" |
0x000031762D706477 |
| Namespaces | "wdpns-v1" |
0x31762D736E706477 |
Same algorithm works in Python, JS, Go, etc:
import xxhash
WDP_SEED = 0x000031762D706477
hash_value = xxhash.xxh3_64(input_bytes, seed=WDP_SEED)
xxHash3 is NOT cryptographically secure. It's designed for speed and distribution quality. Use TLS/JWT for security requirements.
MIT or Apache-2.0.