Skip to content

Removes use of deprecated Buffer constructor#66

Closed
skibz wants to merge 4 commits intoretailnext:masterfrom
skibz:fix-buffer-deprecation-warnings-1
Closed

Removes use of deprecated Buffer constructor#66
skibz wants to merge 4 commits intoretailnext:masterfrom
skibz:fix-buffer-deprecation-warnings-1

Conversation

@skibz
Copy link
Contributor

@skibz skibz commented Nov 16, 2022

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

@jlutheratwork
Copy link
Contributor

Thank you for the PR, @skibz.

Would you please update the minimum node version in

"engines": { "node": ">=0.8.0" },
?

@skibz
Copy link
Contributor Author

skibz commented Nov 18, 2022

Certainly!

@skibz skibz closed this by deleting the head repository Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants