mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
11 lines
217 B
TypeScript
11 lines
217 B
TypeScript
export default function bytesToBase64(bytes: Uint8Array) {
|
|
let binary = '';
|
|
for (const byte of bytes) {
|
|
binary += String.fromCharCode(byte);
|
|
}
|
|
|
|
const base64String = btoa(binary);
|
|
|
|
return base64String;
|
|
}
|