base64 encode string from a terminal?

2019-09-05 23:03发布

OS X 10.8.3 C++

We have base64 encode and decode functions in our code.

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.

How does one base64 encode a string from a terminal?

1条回答
The star\"
2楼-- · 2019-09-05 23:28

Using the base64 command, sensibly enough:

# echo Hello | base64
SGVsbG8K
# echo SGVsbG8K | base64 -D
Hello
查看更多
登录 后发表回答