Skip to content

Commit 1612532

Browse files
committed
Remove mentions of Farmhash
1 parent 3587746 commit 1612532

File tree

1 file changed

+2
-32
lines changed

1 file changed

+2
-32
lines changed

text/0000-one-shot-hashing.md

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
# Summary
77
[summary]: #summary
88

9-
Extend the `Hasher` trait with a `fn delimit` method. Add an unstable Farmhash
10-
implementation to the standard library.
9+
Extend the `Hasher` trait with a `fn delimit` method.
1110

1211
# Motivation
1312
[motivation]: #motivation
@@ -48,45 +47,16 @@ trait Hasher {
4847
}
4948
```
5049

51-
Farmhash is introduced as an unstable struct at `core::hash::FarmHasher`. It
52-
should not be exposed in to users of stable Rust.
53-
54-
It may be implemented in the standard library as follows.
55-
56-
```rust
57-
struct FarmHasher {
58-
hash: u64
59-
}
60-
61-
impl Hasher for FarmHasher {
62-
fn write(&mut self, input: &[u8]) {
63-
self.hash = farmhash::hash64(input);
64-
}
65-
66-
fn delimit(&mut self, _len: usize) {
67-
// Nothing to do.
68-
}
69-
70-
fn finish(&mut self) -> u64 {
71-
self.hash
72-
}
73-
}
74-
```
75-
7650
# Drawbacks
7751
[drawbacks]: #drawbacks
7852

79-
* There will be yet another hashing algorithm to maintain in the standard library.
8053
* The `Hasher` trait becomes larger.
8154

8255
# Alternatives
8356
[alternatives]: #alternatives
8457

85-
* Leaving out either or both of these. This means adaptive hashing won't work for
58+
* Leaving out this, which means adaptive hashing may not work for
8659
string and slice types.
87-
* Introducing Farmhash as an unstable function.
88-
* Adding the `fn delimit` method, but leaving out Farmhash.
89-
* Using MetroHash or some other algorithm instead of Farmhash.
9060
* Changing SipHash to ignore the first delimiter.
9161

9262
# Unresolved questions

0 commit comments

Comments
 (0)