Skip to main content

Crate osom_lib_hashes

Crate osom_lib_hashes 

Source
Expand description

This crate defines various hashing functions, which are ABI stable (as in #[repr(C)]).

Additionally all the hash functions here work in the const context.

The crate is #![no_std].

§Notes

In terms of raw performance:

  • FxHash is the fastest.
  • SipHash and FNV1a_64 are over twice as slow.
  • SHA2_256_Portable is obviously the slowest, like 40x slower than FxHash.
  • However platform specific implementations of SHA2_256 are actually quite fast. Especially for bigger input these are comparable with SipHash.

So if cryptographic security is not a concern, then FxHash is a valid choice, since it also is quite ok in terms of collision resistance.

Modules§

fnv
Holds the implementation of several variants of Fowler–Noll–Vo hash functions and their corresponding builders.
fxhash
Holds the implementation of the FxHash algorithm.
sha2
Holds the implementation of some SHA-2 variants.
siphash
Holds the implementation of the SipHash algorithm.
traits
Defines hash function traits.