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... 🙈
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 nastyprocess.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... 🙈