Created
January 5, 2017 06:24
-
-
Save dseg/d0e73f91be403d3a3c5a965a2b83b4ec to your computer and use it in GitHub Desktop.
Base64 Encode & Decode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function b64enc { | |
# エンコード。-e は省略可。 | |
if [[ -n $1 ]] && [[ -f $1 ]]; then | |
openssl enc -e -base64 "$1" | |
fi | |
} | |
function b64dec { | |
# デコード | |
if [[ -n $1 ]] && [[ -f $1 ]]; then | |
openssl enc -d -base64 "$1" | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment