[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖
本帖最后由 523066680 于 2016-10-24 10:03 编辑

回复 11# CrLf

   《Why didn't I think of that》

TOP

回复 12# wskwfkbdn
unicode和unicode big endian一般是靠bom来区分字节序的。如果没有bom,你可以直接在tl的C代码的编码检测群中添加一个函数,检测00 0A或0A 00。从而判断大小端。
  1. /*判断大小端*/
  2. int isUnicode(const char* Str)
  3. {
  4. if(!Str){
  5. return false;
  6. }
  7. const unsigned char* bytes=(const unsigned char *)Str;
  8. while(*bytes){
  9. if(bytes[0]==0x00 && bytes[1]==0x0A){
  10. return 1;  //小端
  11. }else if(bytes[0]==0x0A && bytes[1]==0x00){
  12. return 2;  //大端
  13. }
  14. bytes+=2;
  15. }
  16. return 0;                  //除非这个文本一个换行符都没有
  17. }
复制代码

TOP

TL的bug ,unicode 无BOM头识别失败
判定一个人是否为伸手党的标准是取决于他的态度和诚意。

TOP

回复 10# happy886rr


    是哦,我怎么没想到

TOP

回复 9# CrLf
小写aa会被干掉吗?

TOP

本帖最后由 CrLf 于 2016-10-20 23:34 编辑

附顶楼压缩代码:
  1. @echo off
  2. REM 原始数据
  3. set "LINE=TVqQAAMAAAAEAAAA//8AALgAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAA4fug4AtAnNIbgBTM0hVGhpcyBwcm9ncmFtIGNhbm5vdCBiZSBydW4gaW4gRE9TIG1vZGUuDQ0KJAAAAAAAAABQRQAATAECAAAAAAAAAAAAAAAAAOAADwMLAQYAAAAAAAAAAAAAAAAAYBUAAAAQAAAAIAAAAABAAAAQAAAAAgAABAAAAAAAAAAEAAAAAAAAAAAwAAAAAgAANQwBAAMAAAAAABAAABAAAAAAEAAAEAAAAAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="
  4. setlocal enabledelayedexpansion
  5. set "Z=A"
  6. for %%Z in (@,-,#,$,_,},{,],[) do (
  7. for %%S in (!Z!) do (
  8. set "LINE=!LINE:%%S%%S=%%Z!"
  9. )
  10. set "Z=%%Z"
  11. )
  12. echo !LINE!
  13. pause
复制代码

TOP

本帖最后由 CrLf 于 2016-10-20 23:21 编辑

回复 6# happy886rr


    效果很好,尤其是 EXE 的 Base64,但是目前只适用于 A,若要扩展到其他字符,如何区分不同的层?

TOP

回复 5# yu2n

可以想象成俄罗斯套娃

TOP

本帖最后由 happy886rr 于 2016-10-20 21:28 编辑

回复 5# yu2n
加权,谁的权重大,就优先压缩谁。层层嵌套,这只是一层,只压了40%,如果是3层,可以实现体积减少80%,不过得携带通用解压字典。类似过去的电报译码表。经过几次测试,这种算法的有点经常超越7Z的压缩率。要想压得狠,就得带字典。

比如论坛代码遇到g c d这几个组合就会被吃掉,所以可以把**定义为一个字母,总之给一些常用的组合编码,制作成码表,解压的时候根据码表重组。就好比基因工程,基因决定了你的生物性状,但基因只是压缩的编码,生物是由基因调度氨基酸组合成蛋白质构成细胞结构体。这也是仿生学。
1

评分人数

TOP

  1. ::******Base64加权解密器*************
  2. setlocal enabledelayedexpansion
  3. set "Z=A"&(for %%Z in ([,],{,},_,$,#,-,@) do (set "Z=!Z!!Z!"&for %%S in (!Z!) do (set "LINE=!LINE:%%Z=%%S!")))&echo !LINE:.=!>base64_minitl
复制代码
压缩前 4780 个字符,压缩后 2859 个字符,压缩了 40.19% 。
这算法很好,可惜看不懂。
『千江有水千江月』千江有水,月映千江;万里无云,万里青天。    http://yu2n.qiniudn.com/

TOP

卧槽,史上最快版本迭代

TOP

4096把长行拆成几行了,classpath超出你相信

TOP

真牛           ~
判定一个人是否为伸手党的标准是取决于他的态度和诚意。

TOP

返回列表