Skip to content

Instantly share code, notes, and snippets.

@coderofsalvation
Created January 5, 2014 16:38
Show Gist options
  • Select an option

  • Save coderofsalvation/7456d8554eb46a6acd1c to your computer and use it in GitHub Desktop.

Select an option

Save coderofsalvation/7456d8554eb46a6acd1c to your computer and use it in GitHub Desktop.
base64 encoding functions for bash
encode64()
{
[ -z "$1" ] && return 1
printf "%s\\n" "$1" | openssl enc -base64
}
decode64()
{
[ -z "$1" ] && return 1
printf "%s\\n" "$1" | openssl enc -base64 -d
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment