2016-01-18 17:20:20 +08:00
|
|
|
# base64
|
|
|
|
|
|
|
|
> Encode and decode using Base64 representation.
|
2024-01-31 07:20:27 -03:00
|
|
|
> More information: <https://keith.github.io/xcode-man-pages/base64.1.html>.
|
2016-01-18 17:20:20 +08:00
|
|
|
|
|
|
|
- Encode a file:
|
|
|
|
|
2021-03-07 23:58:11 +01:00
|
|
|
`base64 --input={{plain_file}}`
|
2016-01-18 17:20:20 +08:00
|
|
|
|
|
|
|
- Decode a file:
|
|
|
|
|
2021-03-07 23:58:11 +01:00
|
|
|
`base64 --decode --input={{base64_file}}`
|
2016-01-18 17:20:20 +08:00
|
|
|
|
2022-12-04 08:53:34 +01:00
|
|
|
- Encode from `stdin`:
|
2016-01-18 17:20:20 +08:00
|
|
|
|
2022-02-14 03:21:43 -08:00
|
|
|
`echo -n "{{plain_text}}" | base64`
|
2016-01-18 17:20:20 +08:00
|
|
|
|
2022-12-04 08:53:34 +01:00
|
|
|
- Decode from `stdin`:
|
2016-01-18 17:20:20 +08:00
|
|
|
|
2021-03-07 23:58:11 +01:00
|
|
|
`echo -n {{base64_text}} | base64 --decode`
|