caoge c760052ff9 机车状态修改 | 8 달 전 | |
---|---|---|
.. | ||
test | 8 달 전 | |
.travis.yml | 8 달 전 | |
LICENSE | 8 달 전 | |
README.md | 8 달 전 | |
bm.js | 8 달 전 | |
index.js | 8 달 전 | |
package.json | 8 달 전 |
find the index of a buffer in a buffer. should behave like String.indexOf etc.
var bindexOf = require('buffer-indexof');
var newLineBuffer = new Buffer("\n");
var b = new Buffer("hi\nho\nsilver");
bindexOf(b,newLineBuffer) === 2
// you can also start from index
bindexOf(b,newLineBuffer,3) === 5
// no match === -1
bindexOf(b,newLineBuffer,6) === -1