Skip to content

Instantly share code, notes, and snippets.

@rawyler
Created May 28, 2020 11:33
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rawyler/e9e942963fcbbc28dc267f37e8393508 to your computer and use it in GitHub Desktop.
Save rawyler/e9e942963fcbbc28dc267f37e8393508 to your computer and use it in GitHub Desktop.
Base64 encode/decode shortcut
#!/bin/bash
ENCODED=$(echo -n $1 | base64)
DECODED=$(echo $1 | base64 --decode 2> /dev/null)
printf "\x1b[33mEncoded:\x1b[0m \x1b[32m$ENCODED\x1b[0m\n"
printf "\x1b[33mDecoded:\x1b[0m \x1b[36m$DECODED\x1b[0m\n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment