Skip to content

Instantly share code, notes, and snippets.

View stukennedy's full-sized avatar
💭
getting stuff done

Stu Kennedy stukennedy

💭
getting stuff done
View GitHub Profile
@stukennedy
stukennedy / buffer-moore.js
Created November 12, 2016 00:47
A simple implementation of the Boyer-Moore string search algorithm for use with node.js' Buffer objects.
'use strict'
module.exports = {
alphabetSize: 256,
/*
Returns the index of the first occurence of
the `needle` buffer within the `haystack` buffer.