1.0.6 • Published 9 years ago

karp-rabin-search v1.0.6

Weekly downloads
1
License
MIT
Repository
github
Last release
9 years ago

Rabin Karp Search Algorithm

A Javascript implementation of the Rabin-Karp Algorithm.

It can be used for detecting occurrences of a string in another string. Can be used to detect plagiarism. Note I advise not to use this algo, iteratively calling indexOf yields better performance in V8.

Usage

npm install

var rks = require('rabin-karp-search')

rks.search('There is a pattern in this string', 'pattern') // prints [ 11 ]
rks.search('A pattern and another pattern', 'pattern') // prints [ 2, 22 ]

Tests

run npm test

Dependencies

https://github.com/rsandor/number-theory

License

MIT

1.0.6

9 years ago

1.0.5

9 years ago

1.0.4

9 years ago

1.0.3

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago