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
- Host: GitHub
- URL: https://github.com/lemire/rollinghashjava
- Owner: lemire
- Created: 2011-03-11T15:45:30.000Z (over 14 years ago)
- Default Branch: master
- Last Pushed: 2016-05-07T23:15:49.000Z (about 9 years ago)
- Last Synced: 2024-10-12T21:28:35.927Z (8 months ago)
- Topics: hashing, java, rolling-hash-functions
- Language: Java
- Homepage: http://code.google.com/p/rollinghashjava/
- Size: 3.91 KB
- Stars: 75
- Watchers: 8
- Forks: 13
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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