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