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
{{ message }}
Repository navigation
Buffer.from() ignores byteOffset and length parameters #22387
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).
Also I get the same behavior if I use another type of Buffer than a string. For example:
What you're showing agrees with the documentation. Buffer arguments do not support offset and length, however ArrayBuffer objects do. If you add .buffer to your Buffer instance, you will get an ArrayBuffer.
According to the documentation, the Buffer.from() function should accept byteOffset and length parameters, but those are actually ignored:
Expected output: