mirror of
https://github.com/kmc7468/arkvault.git
synced 2026-02-04 16:16:55 +00:00
파일 다운로드 임시 구현
This commit is contained in:
@@ -1,3 +1,14 @@
|
||||
const textEncoder = new TextEncoder();
|
||||
const textDecoder = new TextDecoder();
|
||||
|
||||
export const encodeString = (data: string) => {
|
||||
return textEncoder.encode(data);
|
||||
};
|
||||
|
||||
export const decodeString = (data: ArrayBuffer) => {
|
||||
return textDecoder.decode(data);
|
||||
};
|
||||
|
||||
export const encodeToBase64 = (data: ArrayBuffer) => {
|
||||
return btoa(String.fromCharCode(...new Uint8Array(data)));
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user