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

DeprecationWarning on Buffer #196

Open
exoego opened this issue Sep 11, 2019 · 3 comments
Open

DeprecationWarning on Buffer #196

exoego opened this issue Sep 11, 2019 · 3 comments

Comments

@exoego
Copy link

exoego commented Sep 11, 2019

I see the below warning on Node.js 10.x and 12.x
[DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.

new Buffer(size) had been deprecated in Node.js 6.0.0 back in 2016-04-26.
https://nodejs.org/api/buffer.html#buffer_new_buffer_size

I suspect these lines

return this.toArrayLike(Buffer, endian, length);

var res = new ArrayType(reqLength);

@exoego
Copy link
Author

exoego commented Sep 11, 2019

Ah, sorry.
These lines come from bn.js.
I will transfer this issue there.
https://github.com/indutny/bn.js/blob/79dccc4d3274ffae17cfb54ce08703a98b1d4fe0/lib/bn.js

@exoego exoego closed this as completed Sep 11, 2019
@exoego
Copy link
Author

exoego commented Sep 11, 2019

Ah, bn.js already addressed deprecation in latest version.
I think elliptic should update bn.js dependeny.
I will open a PR.

@fanatid
Copy link
Contributor

fanatid commented Sep 12, 2019

Duplicate of #191 in some way.

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

Successfully merging a pull request may close this issue.

2 participants