| 编码解码工具 (Written By went.) |
| V3.0.1 2024/06/13 |
| http://www.bathome.net/thread-57518-1-1.html |
| |
| coder.exe 用法: |
| |
| 显示帮助 /? |
| |
| 转换工具 -c <auto|cp1> <cp2> -<s|f> [ ... ] |
| -convert <auto|cp1> <cp2> -<string|file> [ ... ] |
| |
| 查看编码 -s -a <gc|gh> -<s|f> [ ... ] |
| -show -action <getcoder|gethash> -<string|file> [ ... ] |
| |
| 进制工具 -r <2...36> <dc|ec> -<s|f|n> [ ... ] |
| -radix <2...36> <decode|encode> -<string|file|num> [ ... ] |
| |
| url工具 -u -a <dc|ec|eca> -<s|f> [ ... ] |
| -url -action <decode|encode> -<string|file> [ ... ] |
| |
| base64工具 -bs64 -a <dc|ec> -<s|f> [ ... ] |
| -base64 -action <decode|encode> -<string|file> [ ... ] |
| |
| |
| 二维码工具 -qr -a <ec> -<s> [ ... ] |
| -qrcode -action <encode> -<string> [ ... ] |
| |
| 备注: |
| 1. [ ... ] 可选值 [<字符串|文件路径>|管道] |
| 2. cp1,cp2 可选值 参见例子1 |
| 3. 大多数情况下,unicode编码即UTF-16_LE编码 |
| |
| 例子: |
| |
| coder -s -a gc -f "0.txt" |
| 查看文件编码 |
| [ DOS | UNIX | MAC | ANSI | UTF-8 | UTF-8_BOM | UTF-16_BE | UTF-16_LE ] |
| |
| coder -s -a gh -f "coder.exe" |
| 获取文件哈希值(MD5,SHA1,SHA256,SHA512,CRC32) |
| |
| coder -c ansi utf-8 -s "你好,世界!" |
| 字符串编码转换 ansi -> utf8 [浣犲ソ,涓栫晫!] |
| |
| coder -c utf-8 ansi -f "utf8.txt" |
| 文件编码转换 utf8 -> ansi |
| 要生成文件请使用重定向符号 ">" ,参见16进制编解码的例子 |
| |
| coder -c auto ansi -f "1.txt" |
| 文件编码转换,源编码自动识别 -> ansi |
| |
| coder -r 16 ec -n 36:51uoct |
| 36进制数字转16进制 51uoct -> 1234abcd |
| |
| coder -r 10 ec -n 16:1234abcd |
| 16进制数字转10进制 1234abcd -> 305441741 |
| |
| coder -r 2 ec -n 305441741 |
| 10进制数字转2进制 305441741 -> 10010001101001010101111001101 |
| |
| coder -r 16 ec -f "1.exe">"0.hex" |
| 文件16进制编码 |
| |
| coder -r 16 dc -f "0.hex">"1.exe" |
| 文件16进制解码 |
| |
| coder -u -a dc -s "%73%64%2F%E4%BD%A0%E5%A5%BD%21%2F%31%32%33" |
| 字符串URL解码 [sd/你好!/123] |
| |
| coder -bs64 -a ec -f "3.png" >"base64.txt" |
| 文件base64编码,保存到base64.txt |
| |
| coder -bs64 -a dc -f "base64.txt" >"4.png" |
| 文件base64解码,生成4.png |
| |
| coder -qr ec out-con -s "https://www.baidu.com" |
| 字符串生成文本二维码,显示在控制台 |
| |
| coder -qr ec out-str -s "https://www.baidu.com" |
| 字符串生成文本二维码 |
| |
| coder -qr ec out-img -s "https://www.baidu.com" |
| 字符串生成图片二维码 |
| |
| 使用管道输入,例子: |
| |
| for %i in (*.png) do ( echo %i| coder -bs64 -a ec -f >"%i.txt" ) |
| 对当前路径下所有png文件base64进行编码,生成txtCOPY |