bigbuffet-rw/app/soapbox/utils/base64.ts

11 lines
257 B
TypeScript
Raw Normal View History

export const decode = (base64: string) => {
2020-03-27 13:59:38 -07:00
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;
};