2019-02-26 03:07:24 +00:00
|
|
|
# base64
|
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
> 使用 Base64 来进行编码和解码。
|
2024-01-31 10:20:27 +00:00
|
|
|
> 更多信息:<https://keith.github.io/xcode-man-pages/base64.1.html>.
|
2019-02-26 03:07:24 +00:00
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
- 编码目标文件:
|
2019-02-26 03:07:24 +00:00
|
|
|
|
2021-03-07 22:58:11 +00:00
|
|
|
`base64 --input={{目标文件}}`
|
2019-02-26 03:07:24 +00:00
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
- 解码目标文件:
|
2019-02-26 03:07:24 +00:00
|
|
|
|
2021-03-07 22:58:11 +00:00
|
|
|
`base64 --decode --input={{base64 编码文件}}`
|
2019-02-26 03:07:24 +00:00
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
- 通过标准输入管道进行解码:
|
2019-02-26 03:07:24 +00:00
|
|
|
|
2024-01-01 09:38:53 +00:00
|
|
|
`echo -n "{{目标字符串}}" | base64`
|
2019-02-26 03:07:24 +00:00
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
- 解码标准输入管道内容:
|
2019-02-26 03:07:24 +00:00
|
|
|
|
2021-03-07 22:58:11 +00:00
|
|
|
`echo -n {{base64 字符串}} | base64 --decode`
|