indutny / asn1.js

ASN.1 Decoder/Encoder/DSL
MIT License
181 stars 64 forks source link

fix: address buffer constructor deprecation #116

Closed exoego closed 4 years ago

exoego commented 4 years ago

Closes https://github.com/indutny/asn1.js/issues/102

EthanRBrown commented 4 years ago

I was just about to do this myself. Would love to get this fixed because I'm tired of having my AWS logs cluttered up by deprecation warnings. Is this package abandoned by its maintainers?

realanmup commented 4 years ago

[DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead. I'll leave this message here. Please merge it asap. Thank you. @indutny

panva commented 4 years ago

I believe this PR is a breaking change for legacy runtimes, it would be appropriate to use this as v6.x breaking, while #103 is suitable for the existing major release line.

exoego commented 4 years ago

I am fine with #103 which uses safe-buffer module to support legacy Node.js. Some people may worry about adding such polyfill since it increases complexity of dependency management and increases bundle size.

indutny commented 4 years ago

Fixed in e186699e18fd45158bfa25225c2ead5804a42d9a