Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix buffer initialization in base64 encoding
If a number was passed to `encode()`, the buffer would be created with uninitialised memory. This patch casts anything that's passed in to a string first and then uses the safe `Buffer.from` API. `Buffer.from` was added in Node v4 but the `buffer-from` module ponyfills it for older Node versions. See [nodejs/node#4660](nodejs/node#4660)
- Loading branch information