feat: Initial commit

This commit is contained in:
engigu
2025-12-20 09:30:16 +08:00
commit 362237241e
189 changed files with 12035 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
import pako from 'pako'
export function decompressFromBase64(compressed: string): string {
if (!compressed) return ''
try {
// Decode base64 to binary
const binaryString = atob(compressed)
const bytes = new Uint8Array(binaryString.length)
for (let i = 0; i < binaryString.length; i++) {
bytes[i] = binaryString.charCodeAt(i)
}
// Decompress gzip
const decompressed = pako.ungzip(bytes, { to: 'string' })
return decompressed
} catch (e) {
console.error('Decompress error:', e)
return '[解压失败]'
}
}