encode64.plugin.zsh 281 B

1234567891011121314151617
  1. encode64() {
  2. if [[ $# -eq 0 ]]; then
  3. cat | base64
  4. else
  5. printf '%s' $1 | base64
  6. fi
  7. }
  8. decode64() {
  9. if [[ $# -eq 0 ]]; then
  10. cat | base64 --decode
  11. else
  12. printf '%s' $1 | base64 --decode
  13. fi
  14. }
  15. alias e64=encode64
  16. alias d64=decode64