chat-server/node_modules/buffer-indexof
jsrobson10 62390df244 Got encrypted, stable communication between the server and the client 2019-03-30 18:34:19 +11:00
..
test Got encrypted, stable communication between the server and the client 2019-03-30 18:34:19 +11:00
.travis.yml Got encrypted, stable communication between the server and the client 2019-03-30 18:34:19 +11:00
LICENSE Got encrypted, stable communication between the server and the client 2019-03-30 18:34:19 +11:00
README.md Got encrypted, stable communication between the server and the client 2019-03-30 18:34:19 +11:00
index.js Got encrypted, stable communication between the server and the client 2019-03-30 18:34:19 +11:00
package.json Got encrypted, stable communication between the server and the client 2019-03-30 18:34:19 +11:00

README.md

Build Status

buffer-indexof

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