将值编码为 base64
我正在尝试在 Lyris ListManager (10.2) 中编写自定义。语言是TCL,我对此知之甚少。我们需要将一个值编码为base64(或者实际上是任何混淆查询字符串参数的值),但我似乎不知道如何编码。 TCL 是否有本地命令可以执行此操作?
I'm trying to write a customization in Lyris ListManager (10.2). The language is TCL, which I know very little about. We need to encode a value as base64 (or really, anything that obfuscates a querystring parameter), but I can't seem to figure out how. Is there a command native to TCL to do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
根据使用 base64 包的问题,您可以使用这些小过程将数据转换为十六进制并返回。需要 Tcl > 8
如果您确实需要base64,您可以从tcllib发行版复制/粘贴整个base64文件 http://sourceforge.net/projects/tcllib/files/tcllib/1.11.1/ 进入您的代码(删除“packageprovided”行)
Following your problem to use the base64 package you can use these little procs to convert your data to hex and back. Requires Tcl > 8
If you really need base64 you can just copy/paste the entire base64 file from the tcllib distribution http://sourceforge.net/projects/tcllib/files/tcllib/1.11.1/ into your code (remove the "package provides" line)
http://tcllib.sourceforge.net/doc/base64.html 的存在似乎表明没有本机函数。您可以复制源并将其添加到您的修改中。
The existence of http://tcllib.sourceforge.net/doc/base64.html seems to indicate that there're no native functions. You could copy the source and add it to your modifications.
如果您能够将 Tcl 库(包/模块)加载到您的环境中,则只需使用 Tcllib 实现。这就是 Vinko Vrsalovic 在他的回应中所显示的命令。
If you have the ability to load Tcl libraries (packages/modules) into your environment, you can just use the Tcllib implementation. That's what Vinko Vrsalovic was showing the command from in his response.
如果仅以十六进制编码就足够了,您可以使用 二进制命令如下:
If it would be good enough to just encode in hexadecimal, you can use the binary command as follows: