0.0.1 • Published 8 years ago

bin-string-search v0.0.1

Weekly downloads
3
License
MIT
Repository
github
Last release
8 years ago

bin-string-search

Search for strings in a collection in up to half the time by using a reductive index that creates a single integer that represents the set of characters in the search terms.

single word searches can take 1/6 to 3/4 the time of an unindexed string search; average times are around 1/3.

How does it work?

Most searches compare sequences of strings. This algorithm reduces a string no matter how long to a 32 bit integer that represents the inclusion or exclusion of its character set.

The first 26 bits map to the alphabet. the remaining bits represent spaces, digits and the more exotic characters (punctuation etc.)

The search term is likewise reduced to a single integer; only when the target is determined to have all the requisite characters and exotics does a full search conclude.

Travis build status Code Climate Test Coverage Dependency Status devDependency Status