mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-16 07:57:33 +08:00
code refactor
This commit is contained in:
@@ -159,6 +159,14 @@ export function base64encode(arrayBuffer) {
|
||||
return btoa(String.fromCharCode.apply(null, new Uint8Array(arrayBuffer)));
|
||||
}
|
||||
|
||||
export function base64decode(str) {
|
||||
if (!str) {
|
||||
return '';
|
||||
}
|
||||
|
||||
return atob(str);
|
||||
}
|
||||
|
||||
export function arrayBufferToString(arrayBuffer) {
|
||||
return String.fromCharCode.apply(null, new Uint8Array(arrayBuffer));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user