All Projects → lemire → Rollinghashcpp

lemire / Rollinghashcpp

Rolling Hash C++ Library

Labels

Projects that are alternatives of or similar to Rollinghashcpp

String Hash
Get the hash of a string
Stars: ✭ 56 (-60.28%)
Mutual labels:  hashing
Webcrypto
W3C Web Cryptography API for Node.js
Stars: ✭ 79 (-43.97%)
Mutual labels:  hashing
Stronglyuniversalstringhashing
Benchmark showing the we can randomly hash strings very quickly with good universality
Stars: ✭ 119 (-15.6%)
Mutual labels:  hashing
Low Latency Android Ios Linux Windows Tvos Macos Interactive Audio Platform
🇸Superpowered Audio, Networking and Cryptographics SDKs. High performance and cross platform on Android, iOS, macOS, tvOS, Linux, Windows and modern web browsers.
Stars: ✭ 1,121 (+695.04%)
Mutual labels:  hashing
Md5 Simd
Accelerate aggregated MD5 hashing performance up to 8x for AVX512 and 4x for AVX2. Useful for server applications that need to compute many MD5 sums in parallel.
Stars: ✭ 71 (-49.65%)
Mutual labels:  hashing
Dsh tensorflow
implemement of DEEP SUPERVISED HASHING FOR FAST IMAGE RETRIEVAL_CVPR2016
Stars: ✭ 97 (-31.21%)
Mutual labels:  hashing
Farmhash.sharp
Port of Google's farmhash algorithm to .NET
Stars: ✭ 52 (-63.12%)
Mutual labels:  hashing
Hash Embeddings
PyTorch implementation of Hash Embeddings (NIPS 2017). Submission to the NIPS Implementation Challenge.
Stars: ✭ 126 (-10.64%)
Mutual labels:  hashing
Memento
Fairly basic redis-like hashmap implementation on top of a epoll TCP server.
Stars: ✭ 74 (-47.52%)
Mutual labels:  hashing
Minperf
A Minimal Perfect Hash Function Library
Stars: ✭ 107 (-24.11%)
Mutual labels:  hashing
Scala Hashing
Fast non-cryptographic hash functions for Scala
Stars: ✭ 66 (-53.19%)
Mutual labels:  hashing
Ssri
Standard Subresource Integrity library for Node.js
Stars: ✭ 69 (-51.06%)
Mutual labels:  hashing
Easycrypt
Android cryptography library with SecureRandom patches.
Stars: ✭ 102 (-27.66%)
Mutual labels:  hashing
Blake2fast
Optimized BLAKE2 hashing implementations in C#
Stars: ✭ 63 (-55.32%)
Mutual labels:  hashing
Data Structures
Data-Structures using C++.
Stars: ✭ 121 (-14.18%)
Mutual labels:  hashing
Fast Near Duplicate Image Search
Fast Near-Duplicate Image Search and Delete using pHash, t-SNE and KDTree.
Stars: ✭ 54 (-61.7%)
Mutual labels:  hashing
Eternal
A C++14 compile-time/constexpr map and hash map with minimal binary footprint
Stars: ✭ 93 (-34.04%)
Mutual labels:  hashing
Sketchy
Sketching Algorithms for Clojure (bloom filter, min-hash, hyper-loglog, count-min sketch)
Stars: ✭ 138 (-2.13%)
Mutual labels:  hashing
Password4j
Password4j is a user-friendly cryptographic library that supports Argon2, Bcrypt, Scrypt, PBKDF2 and various cryptographic hash functions.
Stars: ✭ 124 (-12.06%)
Mutual labels:  hashing
Xxhash cpp
Port of the xxhash library to C++17.
Stars: ✭ 106 (-24.82%)
Mutual labels:  hashing

Randomized rolling hash functions in C++

Build Status

License: Apache 2.0

What is this?

This is a set of C++ classes implementing various recursive n-gram hashing techniques, also called rolling hashing (http://en.wikipedia.org/wiki/Rolling_hash), including:

  • Randomized Karp-Rabin (sometimes called Rabin-Karp)
  • Hashing by Cyclic Polynomials (also known as Buzhash)
  • Hashing by Irreducible Polynomials

This library is used by khmer: the in-memory nucleotide sequence k-mer engine.

These are randomized hash functions, meaning that each time you create a new hasher instance, you will get new hash values for a given input.

Code sample

    const uint n(3);//hash all sequences of 3 characters
    const uint L(7); // you need 7 bits
    CyclicHash<uint32> hf(n,L );// if you want 64-bit values replace uint32 by uint64
    for(uint32 k = 0; k<n;++k) {
              chartype c = ... ; // grab some character
              hf.eat(c); // feed it to the hasher
    }
    while(...) { // go over your string
       hf.hashvalue; // at all times, this contains the hash value
       chartype c = ... ;// point to the next character
       chartype out = ...; // character we want to forget
       hf.update(out,c); // update hash value
    }
    hf.reset(); // you can now hash a new string

Requirements

A recent GNU GCC C++ compiler or a recent CLANG.

What should I do after I download it?

type:

    make

then

    ./unit

then

    ./speedtesting

Nim version

See Cyclic-Polynomial-Hash for a similar library written in Nim.

References

  • Daniel Lemire, Owen Kaser: Recursive n-gram hashing is pairwise independent, at best, Computer Speech & Language, Volume 24, Issue 4, October 2010, Pages 698-710 http://arxiv.org/abs/0705.4676
  • Daniel Lemire, The universality of iterated hashing over variable-length strings, Discrete Applied Mathematics 160 (4-5), 2012. http://arxiv.org/abs/1008.1715
  • Owen Kaser and Daniel Lemire, Strongly universal string hashing is fast, Computer Journal (2014) 57 (11): 1624-1638. http://arxiv.org/abs/1202.4961

This work has been used in genomics, see

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].