bigbuffet-rw/app/soapbox/utils/base64.ts
marcin mikołajczak 2943b91034 Typescript, convert some components to functional
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2022-04-11 21:58:48 +02:00

10 lines
257 B
TypeScript

export const decode = (base64: string) => {
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;
};