elliptic
elliptic copied to clipboard
DeprecationWarning on Buffer
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 https://github.com/indutny/elliptic/blob/71e4e8e2f5b8f0bdbfbe106c72cc9fbc746d3d60/dist/elliptic.js#L4367 https://github.com/indutny/elliptic/blob/71e4e8e2f5b8f0bdbfbe106c72cc9fbc746d3d60/dist/elliptic.js#L4382
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
Ah, bn.js
already addressed deprecation in latest version.
I think elliptic should update bn.js
dependeny.
I will open a PR.
Duplicate of #191 in some way.