Debian Codegraph @

third_party/rust/siphasher/README.md

raw
1 SipHash implementation for Rust
2 ===============================
3
4 This crates implements SipHash-2-4 and SipHash-1-3 in Rust.
5
6 It is based on the original implementation from rust-core and exposes the
7 same API.
8
9 It also implements SipHash variants returning 128-bit tags.
10
11 The `sip` module implements the standard 64-bit mode, whereas the `sip128`
12 module implements the 128-bit mode.
13
14 Usage
15 -----
16 In `Cargo.toml`:
17
18 ```toml
19 [dependencies]
20 siphasher = "0.3"
21 ```
22
23 If you want [serde](https://github.com/serde-rs/serde) support, include the feature like this:
24
25 ```toml
26 [dependencies]
27 siphasher = { version = "0.3", features = ["serde"] }
28 ```
29
30 64-bit mode:
31 ```rust
32 extern crate siphasher;
33
34 use siphasher::sip::{SipHasher, SipHasher13, SipHasher24};
35 ```
36
37 128-bit mode:
38 ```rust
39 use siphasher::sip128::{Hasher128, Siphasher, SipHasher13, SipHasher24};
40 ```
41
42 [API documentation](https://docs.rs/siphasher/)
43 -----------------------------------------------