首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >从shell编码到base32

从shell编码到base32
EN

Server Fault用户
提问于 2012-05-04 20:53:55
回答 2查看 14.9K关注 0票数 10

我希望直接从shell将输入字符串编码为base32编码。我想用ubuntu来做这件事,但我想这里的味道并不重要。

是否有任何现有的linux/unix工具可以简单地做到这一点?

与…有关的东西:

代码语言:javascript
复制
-bash-3.2$ echo -n 'hello' | base32
EN

回答 2

Server Fault用户

发布于 2018-04-10 17:28:07

默认情况下,它作为核心用途的一部分安装在Ubuntu16.04中:

代码语言:javascript
复制
$ which base32
/usr/bin/base32
票数 4
EN

Server Fault用户

发布于 2019-05-18 15:57:10

使用Python:

代码语言:javascript
复制
$ 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'
票数 3
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/386199

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档