node-radius icon indicating copy to clipboard operation
node-radius copied to clipboard

Removes use of deprecated Buffer constructor

Open skibz opened this issue 2 years ago • 2 comments

This patch updates the use of buffers to be in line with current standards.

The biggest upside is that buffers get zero-filled automatically when allocating them with Buffer.alloc, so we get to remove some manual zeroing and zero padding operations throughout the library.

I suppose the change I'm proposing here is no bueno if there's a desire to continue supporting users who are running Node versions prior to v5.10.0 (which is when Buffer.alloc, Buffer.from, and friends were introduced) without adding a nasty process.version conditional or something.

Really hoping that it's unlikely people still use such old versions of Node, though. Node 5 was almost an eternity ago... 🙈

skibz avatar Nov 16 '22 06:11 skibz

Thank you for the PR, @skibz.

Would you please update the minimum node version in https://github.com/retailnext/node-radius/blob/5b55be28a909359a39c703a262814d0efd9b0bb5/package.json#L11?

nearbuyjason avatar Nov 17 '22 21:11 nearbuyjason

Certainly!

skibz avatar Nov 18 '22 10:11 skibz