Published on

base64

Authors
  • avatar
    Name
    Timothy Blanks

Base64 encode file

npx image64 -f file.name
remove image tag

Convert binary returned from an API to base64

        const data = `data:${response.headers['content-type']};base64,${Buffer.from(response.data, 'binary').toString('base64')}`;
        // data is a Data Url

        const blobAdUrl = window.URL.createObjectURL(
            new Blob([response.data], { type: response.headers['content-type'] }),
          );

Javascript

  • from base 64
  atob(base64)
  • to base64
  btoa("asd")

Websites

Decode to file https://base64.guru/converter/decode/file