Skip to content
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

Implementation of the equals method differs from Node.js #218

Open
yvgny opened this issue Aug 29, 2018 · 1 comment
Open

Implementation of the equals method differs from Node.js #218

yvgny opened this issue Aug 29, 2018 · 1 comment
Labels

Comments

@yvgny
Copy link

yvgny commented Aug 29, 2018

Node.js Buffers allow the equality comparison with an Uint8Array, but here it throws a TypeError

For example, this simple statement :

Buffer.from([1 , 2, 3]).equals(new Uint8Array([1, 2, 3]))

returns true on Node.js, but throws an error in the browser.

The equivalent Node.js implementation is here : https://github.com/nodejs/node/blob/88105c998ef9d3f54aa8f22b82ec8cc31cbfac95/lib/buffer.js#L671

@yvgny yvgny changed the title Different implementations of the equals method Implementation of the equals method differs from Node.js Aug 29, 2018
@feross feross added the bug label Sep 5, 2019
@willrnch
Copy link

willrnch commented Jul 15, 2024

should be fixed by #346

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants