base64
/编码的脚本。 有没有办法在脚本中的函数中执行此操作?
well,En/Decode base64的容易性很容易取决于系统上安装的内容。 e.g。
$ openssl enc -base64 <<< 'Hello, World!'
SGVsbG8sIFdvcmxkIQo=
$ openssl enc -base64 -d <<< SGVsbG8sIFdvcmxkIQo=
Hello, World!
1980年以来,这已可以使用Https://en.wikipedia.org/wiki/uuencoding
Busybox具有Https://www.busybox.net/downloads/busybox.html#ueencode具有base64支持:
uuencode [-m] [infile] stored_filename
Uuencode a file to stdout
Options:
-m Use base64 encoding per RFC1521
us示例:
$ echo 'foo' | uuencode -m -
begin-base64 644 -
Zm9vCg==
====
使用其他工具确认它是正确的:
$ echo 'foo' | b64encode -
begin-base64 644 -
Zm9vCg==
====
$ python3 -c 'import base64; print(base64.b64encode(b"foo\n"))'
b'Zm9vCg=='