Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
indexOf that conforms to nodejs 10 tests
This is a JS implementation of indexOf for searching for BufferLists, Buffers, strings and numbers inside a BufferList. It passes the node 10 buffer indexof test suite and works on node 4+. There are quite of a few performance improvements possible, single byte search values can use the native Buffer.indexOf command. Multibyte buffer search values could too with some extra work. I don't believe searching for another buffer list can be made any faster. This takes largely from two places and brings them together - The nodejs buffer index of tests https://github.com/nodejs/node/blob/5d8373a498a50b1387464391402ef22636439303/test/parallel/test-buffer-indexof.js - from @soldair's node-buffer-indexof https://www.npmjs.com/package/buffer-indexof
- Loading branch information