Implement new GC API & rename to zipUtils

This commit is contained in:
KingRainbow44
2022-05-22 23:32:31 -04:00
parent 3554c98339
commit 8383fcfd1f
6 changed files with 15 additions and 7 deletions

View File

@@ -8,4 +8,8 @@ export function byteToString(bytes: number) {
const i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)).toString(), 10)
if (i === 0) return `${bytes} ${sizes[i]}`
return `${(bytes / Math.pow(1024, i)).toFixed(2)} ${sizes[i]}`
}
export function base64Decode(str: string) {
return Buffer.from(str, 'base64').toString('utf8')
}