-
-
Notifications
You must be signed in to change notification settings - Fork 32.8k
Closed
Labels
bufferIssues and PRs related to the buffer subsystem.Issues and PRs related to the buffer subsystem.questionIssues that look for answers.Issues that look for answers.
Description
What's the fastest way to convert a buffer containing base64-encoded data to a buffer containing binary data?
Something like this?
var base64Buffer = ...; // e.g. A buffer containing base64 provided by a mime decoder.
var binaryBuffer = new Buffer(base64Buffer.toString('ascii'), 'base64')
Is there a way to write the base64 buffer directly into another buffer, without creating any interim strings?
I thought of binaryBuffer.write(base64Buffer, 'base64')
but write()
only accepts strings.
riskyMachine
Metadata
Metadata
Assignees
Labels
bufferIssues and PRs related to the buffer subsystem.Issues and PRs related to the buffer subsystem.questionIssues that look for answers.Issues that look for answers.