1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
use cratecompute_hash;
/// A utility struct for namespacing keys using XXH3 hashing.
///
/// This ensures that keys are uniquely identified within a given namespace,
/// even if they share the same suffix. By hashing both the namespace and key
/// separately before combining them, it prevents unintended collisions.
///
/// # Example:
/// ```
/// use simd_r_drive::utils::NamespaceHasher;
///
/// let hasher = NamespaceHasher::new(b"opt");
/// let namespaced_key = hasher.namespace(b"my_key");
/// assert_eq!(namespaced_key.len(), 16, "Namespaced key should be exactly 16 bytes");
/// ```