All Projects → DoumanAsh → xxhash-rust

DoumanAsh / xxhash-rust

Licence: BSL-1.0 License
Rust implementation of xxhash

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to xxhash-rust

XXHash
XXHash - Extremely fast hash algorithm,impl for csharp,can process 11.8 GB/s on modern cpu. impl with net core 2.0 and .net
Stars: ✭ 24 (-57.14%)
Mutual labels:  hash, xxhash
xxHash-Swift
xxHash framework in Swift.
Stars: ✭ 22 (-60.71%)
Mutual labels:  hash, xxhash
Xxhash
Extremely fast non-cryptographic hash algorithm
Stars: ✭ 5,783 (+10226.79%)
Mutual labels:  hash, xxhash
hash-wasm
Lightning fast hash functions using hand-tuned WebAssembly binaries
Stars: ✭ 382 (+582.14%)
Mutual labels:  hash, xxhash
murmur3
A rust implementation of murmur3
Stars: ✭ 48 (-14.29%)
Mutual labels:  hash
fingerprint-brunch
A brunch plugin for cache busting assets
Stars: ✭ 15 (-73.21%)
Mutual labels:  hash
awesome-identicons
A curated list of "Visual Hashs" (Identicon, Avatar, Fractal, RandomArt and general Hash Visualization)
Stars: ✭ 156 (+178.57%)
Mutual labels:  hash
lthash
A homomorphic hash function
Stars: ✭ 61 (+8.93%)
Mutual labels:  hash
server
Hashtopolis - A Hashcat wrapper for distributed hashcracking
Stars: ✭ 954 (+1603.57%)
Mutual labels:  hash
merkle
Golang Merkle Tree Implementation. With hash.Hash interface for streaming support
Stars: ✭ 50 (-10.71%)
Mutual labels:  hash
ArduinoSpritzCipher
Spritz encryption system portable C library, CSPRNG, cryptographic hash and MAC functions, symmetric-key data encryption, and general-purpose functions. It's also an Arduino library.
Stars: ✭ 67 (+19.64%)
Mutual labels:  hash
bcrypt
Swift implementation of the BCrypt password hashing function
Stars: ✭ 30 (-46.43%)
Mutual labels:  hash
password-dart
A set of high-level APIs over PointyCastle and CryptoUtils to hash and verify passwords securely.
Stars: ✭ 40 (-28.57%)
Mutual labels:  hash
php-ntlm
Message encoder/decoder and password hasher for the NTLM authentication protocol
Stars: ✭ 14 (-75%)
Mutual labels:  hash
agent-python
Official python agent for using the distributed hashcracker Hashtopolis
Stars: ✭ 39 (-30.36%)
Mutual labels:  hash
LinuxHashCracker
🔨 Linux Hash Cracker
Stars: ✭ 19 (-66.07%)
Mutual labels:  hash
node-cryptonight
node bindings for cryptonight hashing
Stars: ✭ 15 (-73.21%)
Mutual labels:  hash
node-object-hash
Node.js object hash library with properties/arrays sorting to provide constant hashes. It also provides a method that returns sorted object strings that can be used for object comparison without hashes.
Stars: ✭ 69 (+23.21%)
Mutual labels:  hash
xxhashdir
⚡Fast filysystem fingerprinting using xxHash
Stars: ✭ 47 (-16.07%)
Mutual labels:  xxhash
heimdall
Secure Password Storage
Stars: ✭ 38 (-32.14%)
Mutual labels:  hash

xxhash-rust

Rust Crates.io Documentation

Implementation of xxHash in Rust

Each algorithm is implemented via feature, allowing precise control over code size.

Example

use xxhash_rust::const_xxh3::xxh3_64 as const_xxh3;
use xxhash_rust::xxh3::xxh3_64;

const TEST: u64 = const_xxh3(b"TEST");

fn test_input(text: &str) -> bool {
    match xxh3_64(text.as_bytes()) {
        TEST => true,
        _ => false
    }
}

assert!(!test_input("tEST"));
assert!(test_input("TEST"));

Features:

By default all features are off.

  • xxh32 - Enables 32bit algorithm. Suitable for x86 targets
  • const_xxh32 - const fn version of xxh32 algorithm
  • xxh64 - Enables 64 algorithm. Suitable for x86_64 targets
  • const_xxh64 - const fn version of xxh64 algorithm
  • xxh3 - Enables xxh3 family of algorithms, superior to xxh32 and xxh64 in terms of performance.
  • const_xxh3 - const fn version of xxh3 algorithm

HW acceleration

Similar to reference implementation, crate implements various SIMDs in xxh3 depending on provided flags. All checks are performed only at compile time, hence user is encouraged to enable these accelerations (for example via -C target_cpu=native)

Used SIMD acceleration:

  • SSE2 - widely available, can be safely enabled in 99% of cases. Enabled by default in x86_64 targets.
  • AVX2;

Streaming vs One-shot

For performance reasons one-shot version of algorithm does not re-use streaming version. Unless needed, user is advised to use one-shot version which tends to be more optimal.

cosnt fn version

While const fn provides compile time implementation, it does so at performance cost. Hence you should only use it at compile time.

To guarantee that something is computed at compile time make sure to initialize hash output as const or static variable, otherwise it is possible function is executed at runtime, which would be worse than regular algorithm.

const fn is implemented in best possible way while conforming to limitations of Rust const fn, but these limitations are quite strict making any high performance code impossible.

Version note

  • 0.8.2 corresponds to C's 0.8.0

  • 0.8.3 corresponds to C's 0.8.1

In order to keep up with original implementation version I'm not planning to bump major/minor until C implementation does so.

Comparison with twox-hash

Refer to my comment

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].