Notes to Self

Alex Sokolsky's Notes on Computers and Programming

base64 cli

man base64

Encode

echo -n 'Hello, World!' | base64

This will give SGVsbG8sIFdvcmxkIQ==.

Use of here-string to provide the input will append a newline:

$ base64 <<< 'Hello, World!'
SGVsbG8sIFdvcmxkIQo=

Decode

You can use echo or here-doc to provide the input:

$ base64 -d <<< SGVsbG8sIFdvcmxkIQo=
Hello, World!