symbol-sdk-typescript-javascript icon indicating copy to clipboard operation
symbol-sdk-typescript-javascript copied to clipboard

[DEP0005] DeprecationWarning: Buffer() is deprecated

Open keiyow opened this issue 4 years ago • 0 comments

  1. Expected behavior and actual behavior.

I got an error.

(node:83482) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.

I think should use Buffer.from instead of new Buffer.

$ grep -nrE '[^a-zA-Z](Slow)?Buffer\s*\(' --exclude-dir node_modules/symbol-sdk/*
node_modules/symbol-sdk/dist/src/core/format/RawAddress.js:84:    const ripemdHash = new ripemd160().update(new Buffer(publicKeyHash)).digest();
node_modules/symbol-sdk/src/core/format/RawAddress.ts:86:        const ripemdHash = new ripemd160().update(new Buffer(publicKeyHash)).digest();

https://github.com/nemtech/symbol-sdk-typescript-javascript/blob/main/src/core/format/RawAddress.ts#L86

  1. Steps to reproduce the problem.

  2. Specifications like the version of the project, operating system, or hardware.

nodejs v10.24.0 sdk 0.23.2

keiyow avatar Mar 03 '21 14:03 keiyow