hash-index 0.1.1

Predictable hash indexing with a possible maximum value. Rust adaptation of watson/hash-index using Blake3
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
extern crate hash_index;

#[test]
fn hasher() {
  assert_eq!(hash_index::hash(b"foobar"), 2857448067);
  assert_eq!(
    hash_index::hash(b"The quick brown fox jumps over the lazy dog"),
    789898499
  );
  assert_eq!(hash_index::hash_with_max(b"foobar", 100), 67);
  assert_eq!(
    hash_index::hash_with_max(b"The quick brown fox jumps over the lazy dog", 100),
    99
  );
}