buffer icon indicating copy to clipboard operation
buffer copied to clipboard

Support 'buffer' encoding

Open d3lm opened this issue 6 years ago • 1 comments
trafficstars

Since Node.js v10.0.0 crypto.DEFAULT_ENCODING is deprecated and the default value is now 'buffer', which makes methods default to Buffer objects. I am running into an issue where Buffer.from is called on a string, but the encoding is buffer. That throws an exception because Buffer.isEncoding doesn't support the buffer encoding.

I'd suggest to add this to allow users to integrate this with a more up-to-date version of node.

Would it already work if we just adjust Buffer.isEncoding and add buffer as one of the supported types? Or do we need to do more to make this work?

d3lm avatar Feb 19 '19 13:02 d3lm

I haven't had time to look into this, but I would accept a PR that fixes this issue. Cheers!

feross avatar Sep 10 '19 23:09 feross