-
Notifications
You must be signed in to change notification settings - Fork 1
Encode Base64
Naser edited this page Mar 27, 2023
·
6 revisions
The base64
sub-command of encode
, allows users to encode and decode Base64 text.
nhash encode base64 <text> [options]
-
<text>
: Text to encode or decode in Base64 format.
-
-d, --decode
: Decodes the Base64 text instead of encoding it. -
-o, --output <output>
: File name to write the output to. -
-?, -h, --help
: Show help and usage information.
- Encoding a string in Base64:
nhash encode base64 "Hello, World"
Output:
SGVsbG8sIFdvcmxk
- Decoding a Base64 string:
nhash encode base64 SGVsbG8sIFdvcmxkIQ== -d
Output:
Hello, World!
- Encoding a string and writing the output to a file:
nhash encode base64 "Hello, World" --output encoded.txt
Output:
The encoded text is written to the encoded.txt file.
- Decoding a Base64 string and writing the output to a file:
nhash encode base64 SGVsbG8sIFdvcmxkIQ== -d --output decoded.txt
Output:
The decoded text is written to the decoded.txt file.