-
Notifications
You must be signed in to change notification settings - Fork 29.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Buffer.prototype.lastIndexOf() #4604
Comments
I believe that comes from the EDIT:
|
|
It also has the same method signature: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/indexOf |
@felixfbecker I think Buffer's |
@felixfbecker Presumably because implementations for |
I'm not familiar with the different algorithms but why has |
@felixfbecker Probably because nobody has created a PR to add |
@mscdex thanks for the explanation. I would say this isnt a high priority, but it's confusing when browsing the API docs to see the |
The implementation of
|
Does documentation for this belong in the buffer API file? (https://github.com/emars/node/blob/master/doc/api/buffer.markdown). I found that the method does not work to search for Sub-Buffers or Strings(returns -1 in both cases), only numbers. Seems kinda buggy to put in the core docs. Any thoughts? |
@emars That's probably worth creating a new issue for. |
I would like to take this up if no one else is already on it. Edit: What do these |
So I have two ways of looking at the implementation for this:
Option one obviously has a big perf hit and two involves either implementing new functions or passing flags to existing ones to tell which end to search from. Which sounds better? Is there another approach that anyone has in mind? |
@zeusdeux sorry, just saw your posts. just posted a PR with a patch. i started working on it on a few days ago on an island in the middle of nowhere :) |
the PR is a work in progress: interface and tests, boyer moore not done. in short, it works but it's slow |
PR now done, I think. Reviewers appreciated! |
Oh hey, this was implemented in 6c1e5ad! |
The docs only mention
indexOf
, but it's there, I would like to use it and don't feel good using undocumented APIThe text was updated successfully, but these errors were encountered: