about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/util/base64.js
blob: 8226e2c54ec04cba25d120cc9f4b163124e953d8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
export const decode = base64 => {
  const rawData = window.atob(base64);
  const outputArray = new Uint8Array(rawData.length);

  for (let i = 0; i < rawData.length; ++i) {
    outputArray[i] = rawData.charCodeAt(i);
  }

  return outputArray;
};