批处理之家's Archiver

Batcher 发表于 2009-4-16 23:11

Base64编码、解码工具Base64.exeV1.00

[table=100%,black][tr][td][size=1][color=white]Base64 [options] [input file] [output file]
  options are:
  -i <filename> input file (default: stdin)
  -o <filename> output file (default: stdout)
  -e            encode binary to Base64 (default)
  -d            decode Base64 to binary
  -n <n>        encode n characters per line (0:no line breaks,default:64)
  -E <STRING>   encode and put -----BEGIN/END <STRING>----- around output
  --            indicate end of options
Call as b642bin to preselect decoding
(c) Matthias Gaertner 2002 - v1.00

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.
[/color][/size][/td][/tr][/table]
本地下载:[url]http://bcn.bathome.net/s/tool/index.html?key=Base64[/url]

vlem 发表于 2009-7-30 14:51

好东西
省的自己写了
哈哈

SunTB 发表于 2009-10-9 22:38

我从帖子下载了这一工具
使用过程发现字符转换时,Base64编码末尾总不正确
比如说:
字符串“Batcher”转换后应为“QmF0Y2hlcg==”而它是“QmF0Y2hlcg0K”
字符串“suntb”转换后应为“c3VudGI=”而它是“c3VudGINCg==

是否和我处理的命令方式有关?
我是先设置变量str
然后echo %str%|base64

[[i] 本帖最后由 SunTB 于 2009-10-9 22:41 编辑 [/i]]

zqz0012005 发表于 2009-10-9 22:41

你在字符串末尾加了回车[code]set/p=Batcher<nul|Base64.exe[/code]

SunTB 发表于 2009-10-9 22:44

[quote]原帖由 [i]zqz0012005[/i] 于 2009-10-9 22:41 发表 [url=http://bbs.bathome.net/redirect.php?goto=findpost&pid=39001&ptid=4194][img]http://bbs.bathome.net/images/common/back.gif[/img][/url]
你在字符串末尾加了回车set/p=Batcher [/quote]

F:\批处理\软件>set/p=Batcher<nul|Base64.exe
QmF0Y2hlciA=

还是不对啊

SunTB 发表于 2009-10-9 23:09

倒是下面这个结果正确,但是得按两次回车(应该是用了两个set/p的缘故)才显示数据,郁闷

F:\批处理\软件>set/p=Batcher|Base64.exe
QmF0Y2hlcg==

代码贴上来老大们帮忙看看问题出在哪[code]@echo off
:begin
cls
set /p str=输入要转换的内容:
set/p=%str%|base64
pause>nul&goto :begin[/code]

[[i] 本帖最后由 SunTB 于 2009-10-9 23:13 编辑 [/i]]

Batcher 发表于 2009-10-9 23:22

顶楼这个工具主要用于对文件内容进行Base64编码,如果需要对字符串进行编码,推荐sum.exe
[url]http://bbs.bathome.net/thread-3981-1-1.html[/url]

zqz0012005 发表于 2009-10-10 08:27

set/p=Batcher<nul|Base64.exe 原来Batcher后面多了空格。
看来又和预处理有关,预处理时对语句进行标准格式化,变成了set/p=Batcher 0<nul  | Base64.exe

这里又提醒了大家,在管道符前后的命令中使用重定向符号时会引入额外的空格,以前注意到使用连接符&、&&、|| 时会产生空格,这都是预处理带来的问题。[code](set/p=Batcher|base64.exe)<nul[/code][code]cmd/c"set/p=Batcher<nul"|base64.exe[/code]

cjiabing 发表于 2010-3-2 01:35

使用说明翻译

Base64 [options] [input file] [output file]
  options are:
  -i <filename> input file (default: stdin)
  -o <filename> output file (default: stdout)
  -e            encode binary to Base64 (default)
  -d            decode Base64 to binary
  -n <n>        encode n characters per line (0:no line breaks,default:64)
  -E <STRING>   encode and put -----BEGIN/END <STRING>----- around output
  --            indicate end of options
Call as b642bin to preselect decoding
(c) Matthias Gaertner 2002 - v1.00

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.
——————————————————————————————————————
Base64 [选项] [输入文件] [输出文件]         ——命令格式
  选项有:
  -i  <文件名>    输入文件(默认是:标准输入)
  -o <文件名>    输出文件(默认是:标准输出)
  -e      二进制Base64编码(默认)
  -d      解码为二进制的Base64
    -n <n>        每行(0:n个字符的编码不换行,默认值:64)
  -E <字符串>    编码,把-----BEGIN/END <字符串> -----各地输出
  -     表明选项结束    ——帮助说明
   传唤b642bin预选解码
(三)马蒂亚斯格特纳2002 - v1.00

本程序是,希望这将是有益的,但没有任何担保,甚至没有暗示的保证,适销性或针对特定用途的保证。见GNU通用公共许可证的更多细节。

947967661 发表于 2018-3-5 10:23

感谢您的分享,论坛有你更精彩,谢谢!!!!

netdzb 发表于 2019-7-9 16:17

[b]回复 [url=http://www.bathome.net/redirect.php?goto=findpost&pid=26850&ptid=4194]1#[/url] [i]Batcher[/i] [/b]

站长这个工具还有更新吗?

页: [1]

Powered by Discuz! Archiver 7.2  © 2001-2009 Comsenz Inc.