base64编码与解码

假设有一个文件 example.txt,其内容如下:

Hello, World!

可以使用以下命令将其编码为 Base64:

base64 example.txt > example_encoded.txt

编码后的 example_encoded.txt 内容如下:

SGVsbG8sIFdvcmxkIQo=

2. Base64 解码文件

将 Base64 编码的文件解码回原始内容:

base64 -d encodedfile > decodedfile
  • encodedfile 是要进行 Base64 解码的文件。
  • decodedfile 是保存解码结果的文件。

直接在终端中进行编码和解码

base64 example.txt

SGVsbG8sIFdvcmxkIQo=

解码:

echo "SGVsbG8sIFdvcmxkIQo=" | base64 -d

Hello, World!

 

posted @   不会跳舞的胖子  阅读(35)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 使用C#创建一个MCP客户端
· 分享一个免费、快速、无限量使用的满血 DeepSeek R1 模型,支持深度思考和联网搜索!
· ollama系列1:轻松3步本地部署deepseek,普通电脑可用
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· 按钮权限的设计及实现
历史上的今天:
2022-08-01 windows doc命令总结
2022-08-01 zabbix 监控nginx
点击右上角即可分享
微信分享提示