Thursday 4 May 2017

Generate base64 string from byte array in Javascript

I am parsing a POP3 email header, and I need to generate the base64 code for each attachment.

The JSON file for the email looks like this, where the attachment looks like an array of bytes.

Is there any way to transform this list into a single base64 string using Javascript?

{
  "attachments":[
  {
       "type":"attachment",
       "content":
        {
            "type":"Buffer",
            "data":[137,80,78,71,13,10,26,10,0,0,0,13,73]
        }
  }]
}



via Arturo

No comments:

Post a Comment