You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This has been nagging me for a while, wanting to efficiently search a buffer for a sub-string/buffer, similar to memchr/memcmp, joining Array.prototype.indexOf and String.prototype.indexOf.
I finally got around to implement it as a native module: buffer-indexof-fast (on npm and github). The semantics are 100% compatible to String.prototype.indexOf.
I know there is some discussion going on in terms of what to put into core and what not, but I figured since Buffers are such a fundamental means of sharing information, especially also with the "core", I'll just as the following question...
Would you like to have such a functionality in node-buffers? I would be open to do the work necessary to get it cleaned up and match the code quality of core, if it shows that there is the demand for it.
@srijs After your PR is accepted here, if you're feeling ambitious, please also send a PR to the npm module buffer so browserify users can use the new API too!
Activity
vkurchatkin commentedon Dec 6, 2014
+1, also everything else from
%TypedArray%.prototypebnoordhuis commentedon Dec 6, 2014
.indexOf() and .lastIndexOf() seem unobjectionable to me. PR welcome!
indutny commentedon Dec 7, 2014
+1
benjamingr commentedon Dec 7, 2014
+1 for this, definitely something I needed before and didn't have.
feross commentedon Dec 7, 2014
+1.
@srijs After your PR is accepted here, if you're feeling ambitious, please also send a PR to the npm module
bufferso browserify users can use the new API too!indutny commentedon Dec 8, 2014
Summoning @caineio
juliangruber commentedon Dec 8, 2014
zeusdeux commentedon Dec 10, 2014
👍
a8m commentedon Dec 13, 2014
+1, also for
.lastIndexOf()srijs commentedon Dec 14, 2014
PR: #160
brendanashworth commentedon Mar 5, 2015
Closing as #561 was merged.
chakrashim: Fix bug in repl scenario
napi: RangeError (nodejs#95)