An open API service indexing awesome lists of open source software.

https://github.com/lemire/rollinghashjava

Rolling hash functions in Java
https://github.com/lemire/rollinghashjava

hashing java rolling-hash-functions

Last synced: 3 months ago
JSON representation

Rolling hash functions in Java

Awesome Lists containing this project

README

        

## Rolling hash functions in Java

License: Apache 2.0

## What is this?

This is a set of Java 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)

## Code sample

```java
String s = "some string";
int n = 3; //hash all sequences of 3 characters
CyclicHash ch = new CyclicHash(n);
int k = 0;
for(; k