回复 23# CrLf
那个js对单纯的A压缩的不够好,还是你的那条数据,例如 576 字节长的编码js版压缩为345 字节,但我用批能压缩到243字节,远超rar和7z
Base64压缩机- @echo off
- REM 原始数据
- set "LINE=TVqQAAMAAAAEAAAA//8AALgAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAA4fug4AtAnNIbgBTM0hVGhpcyBwcm9ncmFtIGNhbm5vdCBiZSBydW4gaW4gRE9TIG1vZGUuDQ0KJAAAAAAAAABQRQAATAEFAJOHz1cAAAAAAAAAAOAADwMLAQI4AAwAAAAUAAAAAgAAIBIAAAAQAAAAIAAAAABAAAAQAAAAAgAABAAAAAEAAAAEAAAAAAAAAABgAAAABAAAUV0AAAMAAAAAACAAABAAAAAAEAAAEAAAAAAAABAAAAAAAAAAAAAAAABQAABAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC50ZXh0AAAAFAoAAAAQAAAADAAAAAQAAAAAAAAAAAAAAAAAAGAAAGAuZGF0YQAAAEAAAAAAIAAA"
- REM 压缩数据
- setlocal enabledelayedexpansion
- for /l %%i in (1,1,10000) do (
- if "!LINE:~0,1!"=="A" (
- set/a i+=1
- ) else (
- if !i! neq 0 (
- set M=512
- for %%Z in (@,-,#,$,_,},{,],[,A) do (
- if !i! geq !M! (
- set "S=!S!%%Z"
- set/a "i-=M"
- )
- set/a "M>>=1"
- )
- )
- if "!LINE!"=="" (echo !S!>压缩.txt&exit) else (set "S=!S!!LINE:~0,1!")
- )
- set "LINE=!LINE:~1!"
- )
复制代码 Base64解压机- REM 解压数据
- set/p LINE=<压缩.txt
- setlocal enabledelayedexpansion
- set "Z=A"&(for %%Z in ([,],{,},_,$,#,-,@) do (set "Z=!Z!!Z!"&for %%S in (!Z!) do (set "LINE=!LINE:%%Z=%%S!")))&echo !LINE!>解压.txt
复制代码
|