File tree 3 files changed +11
-11
lines changed
3 files changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -8,24 +8,24 @@ const PRIME: u32 = 0x1000193;
8
8
/// Specifically this implements the [FNV-1a hash].
9
9
///
10
10
/// [FNV-1a hash]: https://en.wikipedia.org/wiki/Fowler%E2%80%93Noll%E2%80%93Vo_hash_function#FNV-1a_hash
11
- pub struct Hasher {
11
+ pub struct FnvHasher {
12
12
state : u32 ,
13
13
}
14
14
15
- impl Default for Hasher {
15
+ impl Default for FnvHasher {
16
16
fn default ( ) -> Self {
17
17
Self { state : BASIS }
18
18
}
19
19
}
20
20
21
- impl crate :: Hasher for Hasher {
21
+ impl crate :: Hasher for FnvHasher {
22
22
#[ inline]
23
23
fn finish32 ( & self ) -> u32 {
24
24
self . state
25
25
}
26
26
}
27
27
28
- impl core:: hash:: Hasher for Hasher {
28
+ impl core:: hash:: Hasher for FnvHasher {
29
29
#[ inline]
30
30
fn write ( & mut self , bytes : & [ u8 ] ) {
31
31
for byte in bytes {
Original file line number Diff line number Diff line change 48
48
) ]
49
49
#![ no_std]
50
50
51
- pub use crate :: fnv:: Hasher as FnvHasher ;
52
- pub use crate :: murmur3:: Hasher as Murmur3Hasher ;
51
+ pub use crate :: fnv:: FnvHasher ;
52
+ pub use crate :: murmur3:: Murmur3Hasher ;
53
53
54
54
mod fnv;
55
55
mod murmur3;
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ use core::slice;
4
4
use crate :: Hasher as _;
5
5
6
6
/// 32-bit `MurmurHash3` hasher
7
- pub struct Hasher {
7
+ pub struct Murmur3Hasher {
8
8
buf : Buffer ,
9
9
index : Index ,
10
10
processed : u32 ,
@@ -50,7 +50,7 @@ impl From<usize> for Index {
50
50
}
51
51
}
52
52
53
- impl Hasher {
53
+ impl Murmur3Hasher {
54
54
/// # Safety
55
55
///
56
56
/// The caller must ensure that `self.index.usize() + buf.len() <= 4`.
@@ -72,7 +72,7 @@ impl Hasher {
72
72
}
73
73
}
74
74
75
- impl Default for Hasher {
75
+ impl Default for Murmur3Hasher {
76
76
fn default ( ) -> Self {
77
77
Self {
78
78
buf : Buffer {
@@ -85,7 +85,7 @@ impl Default for Hasher {
85
85
}
86
86
}
87
87
88
- impl crate :: Hasher for Hasher {
88
+ impl crate :: Hasher for Murmur3Hasher {
89
89
fn finish32 ( & self ) -> u32 {
90
90
// tail
91
91
let mut state = match self . index {
@@ -128,7 +128,7 @@ impl crate::Hasher for Hasher {
128
128
}
129
129
}
130
130
131
- impl core:: hash:: Hasher for Hasher {
131
+ impl core:: hash:: Hasher for Murmur3Hasher {
132
132
#[ inline]
133
133
fn write ( & mut self , bytes : & [ u8 ] ) {
134
134
let len = bytes. len ( ) ;
You can’t perform that action at this time.
0 commit comments