来自终端的base64编码字符串? [英] base64 encode string from a terminal?
本文介绍了来自终端的base64编码字符串?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
OS X 10.8.3 C ++
OS X 10.8.3 C++
我们的代码中具有base64编码和解码功能.
We have base64 encode and decode functions in our code.
但是,我想对终端中的字符串进行base64编码,并在代码中使用它,以便我们的函数可以在需要使用它时对其进行解码.
However, I want to base64 encode a string from my terminal and use it in my code so our functions can decode it when it needs to be used.
一个base64如何编码来自终端的字符串?
How does one base64 encode a string from a terminal?
推荐答案
使用base64
命令,足够明智:
# echo Hello | base64
SGVsbG8K
# echo SGVsbG8K | base64 -D
Hello
这篇关于来自终端的base64编码字符串?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文