#crypto #hash #siphash

siphasher

SipHash-2-4, SipHash-1-3 and 128-bit variants in pure Rust

19 releases

0.3.10 Mar 6, 2022
0.3.7 Sep 2, 2021
0.3.6 Jul 26, 2021
0.3.5 Mar 19, 2021
0.1.3 Nov 29, 2016

#37 in Cryptography

Download history 325372/week @ 2022-08-15 305836/week @ 2022-08-22 331638/week @ 2022-08-29 331878/week @ 2022-09-05 327020/week @ 2022-09-12 332119/week @ 2022-09-19 343258/week @ 2022-09-26 328299/week @ 2022-10-03 363270/week @ 2022-10-10 371876/week @ 2022-10-17 352129/week @ 2022-10-24 350448/week @ 2022-10-31 346877/week @ 2022-11-07 375187/week @ 2022-11-14 291609/week @ 2022-11-21 334850/week @ 2022-11-28

1,370,013 downloads per month
Used in 3,210 crates (71 directly)

MIT/Apache

52KB
1.5K SLoC

SipHash implementation for Rust

This crates implements SipHash-2-4 and SipHash-1-3 in Rust.

It is based on the original implementation from rust-core and exposes the same API.

It also implements SipHash variants returning 128-bit tags.

The sip module implements the standard 64-bit mode, whereas the sip128 module implements the 128-bit mode.

Usage

In Cargo.toml:

[dependencies]
siphasher = "0.3"

If you want serde support, include the feature like this:

[dependencies]
siphasher = { version = "0.3", features = ["serde"] }

64-bit mode:

extern crate siphasher;

use siphasher::sip::{SipHasher, SipHasher13, SipHasher24};

128-bit mode:

use siphasher::sip128::{Hasher128, Siphasher, SipHasher13, SipHasher24};

API documentation

Dependencies

~160KB