|
1 | | -# Traits and utilities for making hashes of any type |
2 | | - |
3 | | -This crate provides the [`Hash`], [`Hasher`] and [`BuildHasher`] traits, which are almost |
4 | | -exactly like their counterparts in `core`/`std`, except that [`Hasher`] and [`BuildHasher`] |
5 | | -are generic over the type of the hash, and [`Hash`] can be used with any type of hash. |
6 | | -A derive macro for [`Hash`] is available. |
7 | | - |
8 | | -The [`Hash`] trait uses the [`HasherWrite`] trait for hashing, which has all the write |
9 | | -methods you're familiar with from `Hasher` in core except for the `finish` method, |
10 | | -because [`Hash`] doesn't know the type of the hash. |
11 | | - |
12 | | -Hashing algorithms implement the [`Hasher`] and [`HasherWrite`] traits. [`Hasher`] is |
13 | | -generic over the type of the hash and only contains the `finish` method. It depends on |
14 | | -[`HasherWrite`], so you can use it just like `Hasher` from core. |
15 | | - |
16 | | -This crate also provides tools for working with endian independent hashes, and a few |
17 | | -hasher implementations. |
18 | | - |
19 | | -### Features |
20 | | - |
21 | | -The crate is `no_std` and doesn't enable any features by default. The following features are available: |
22 | | - |
23 | | -- `alloc`: Enable trait implementations for the standard `alloc` crate. |
24 | | -- `std`: Enable trait implementations for the standard `std` crate. Implies `alloc`. |
25 | | - |
26 | | -Optional integrations: |
27 | | - |
28 | | -- `bnum`: Implement [`Hash`] for the `bnum` crate's types, and add support for using them as the hash type for the built-in hashers that can use them. |
29 | | - |
30 | | -Built-in hashers: |
31 | | - |
32 | | -- `fnv`: Hashers using the Fnv1 and Fnv1a algorithms. |
33 | | -- `spooky`: Hashers using the SpookyHash algorithm. V1 and V2 are available. |
34 | | -- `xxh64`: Hasher using the Xxh64 algorithm. |
| 1 | +# This repository has moved to https://codeberg.org/maia/anyhash-rs |
0 commit comments