https://github.com/cldellow/hash-matcher
Implementation of http://pzemtsov.github.io/2016/10/16/custom-hash-function.html in Scala
https://github.com/cldellow/hash-matcher
Last synced: 9 months ago
JSON representation
Implementation of http://pzemtsov.github.io/2016/10/16/custom-hash-function.html in Scala
- Host: GitHub
- URL: https://github.com/cldellow/hash-matcher
- Owner: cldellow
- License: apache-2.0
- Created: 2019-03-05T13:39:47.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-09-27T04:01:33.000Z (almost 7 years ago)
- Last Synced: 2025-02-06T03:41:53.345Z (over 1 year ago)
- Language: Shell
- Size: 17.6 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# hash-matcher
Implements a constant time needle-in-haystack search over byte arrays, using the ideas
from http://pzemtsov.github.io/2016/10/16/custom-hash-function.html
This library is useful for quickly pre-filtering corpora to decide whether to do
further processing.
## Usage
```scala
import com.cldellow.hashmatcher.HashMatcher.createIntHash
val f = createIntHash("food", "good")
f("People eat food".getBytes("UTF-8"), 15) // true
f("Word!".getBytes("UTF-8"), 5) // false
```