Skip to content

Instantly share code, notes, and snippets.

View can-cc's full-sized avatar
🎯
Focusing

放为 can-cc

🎯
Focusing
View GitHub Profile
@can-cc
can-cc / buffer-moore.js
Created February 27, 2016 13:24
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.