-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
Buffer.from() ignores byteOffset and length parameters #22387
Comments
Also, the |
Sorry, I got my copy / paste wrong. I really meant Buffer.from (I just made another test with the Buffer constructor to check, and copied it by mistake).
|
String is not a Buffer. The doc is clear about it. Second and third parameters represent byte offset and length respectively iff the first parameter is an instance of ArrayBuffer. > Buffer.from(new ArrayBuffer(10), 2, 3)
<Buffer 00 00 00> |
What you're showing agrees with the documentation. |
Oh, OK I understand. Sorry for the false bug report. |
According to the documentation, the Buffer.from() function should accept byteOffset and length parameters, but those are actually ignored:
Expected output:
The text was updated successfully, but these errors were encountered: