EOSIO / eosjs-ecc

Elliptic curve cryptography functions: Private Key, Public Key, Signature, AES, Encryption, Decryption
288 stars 119 forks source link

new Buffer is deprecated #33

Closed ghost closed 6 years ago

ghost commented 6 years ago

This PR replaces: new Buffer -> Buffer.from or Buffer.alloc.

We should not use Buffer constructor which is deprecated and unsafe.

The behavior of new Buffer() is different depending on the type of the first argument, security and reliability issues can be inadvertently introduced into applications when argument validation or Buffer initialization is not performed.

To make the creation of Buffer instances more reliable and less error-prone, the various forms of the new Buffer() constructor have been deprecated and replaced by separate Buffer.from(), Buffer.alloc(), and Buffer.allocUnsafe() methods.

Check this out: https://nodejs.org/api/buffer.html#buffer_buffer_from_buffer_alloc_and_buffer_allocunsafe

pur3miish commented 5 years ago

Hi @noelyoo I am having same issues with deprecated warning.

I would like some more information regarding this issue since it has not been resolved.

ghost commented 5 years ago

@pur3miish These will give you enough information: