我希望直接从shell将输入字符串编码为base32编码。我想用ubuntu来做这件事,但我想这里的味道并不重要。
是否有任何现有的linux/unix工具可以简单地做到这一点?
与…有关的东西:
-bash-3.2$ echo -n 'hello' | base32发布于 2018-04-10 17:28:07
默认情况下,它作为核心用途的一部分安装在Ubuntu16.04中:
$ which base32
/usr/bin/base32发布于 2019-05-18 15:57:10
使用Python:
$ python
Python 2.7.14 (default, Sep 27 2017, 12:15:00)
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.37)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import base64
>>> base64.b32encode('hello')
'NBSWY3DP'https://serverfault.com/questions/386199
复制相似问题