osom_lib_hashes/lib.rs
1//! This crate defines various hashing functions, which
2//! are ABI stable (as in `#[repr(C)]`).
3//!
4//! Additionally all the hash functions here work in the
5//! const context.
6//!
7//! The crate is `#![no_std]`.
8//!
9//! # Notes
10//!
11//! In terms of raw performance:
12//! * [`FxHash`][crate::fxhash::FxHash] is the fastest.
13//! * [`SipHash`][crate::siphash::SipHash] and [`FNV1a_64`][crate::fnv::FNV1a_64] are over twice as slow.
14//! * [`SHA2_256_Portable`][crate::sha2::sha2_256::portable::SHA2_256_Portable] is obviously the slowest, like 40x
15//! slower than [`FxHash`][crate::fxhash::FxHash].
16//! * However platform specific implementations of `SHA2_256` are actually quite fast. Especially for bigger
17//! input these are comparable with [`SipHash`][crate::siphash::SipHash].
18//!
19//! So if cryptographic security is not a concern, then [`FxHash`][crate::fxhash::FxHash] is a valid choice,
20//! since it also is quite ok in terms of collision resistance.
21#![deny(warnings)]
22#![allow(unused_features)]
23#![cfg_attr(docsrs, feature(doc_cfg))]
24#![cfg_attr(docsrs, allow(unused_attributes))]
25#![warn(clippy::all, clippy::pedantic)]
26#![allow(clippy::redundant_field_names, clippy::inline_always, clippy::unreadable_literal)]
27#![no_std]
28
29pub mod fnv;
30pub mod fxhash;
31pub mod sha2;
32pub mod siphash;
33pub mod traits;