Skip to content

Instantly share code, notes, and snippets.

@debuti
Last active August 27, 2018 10:58
Show Gist options
  • Save debuti/a2329211febcd602cd90ea2cacae8fc3 to your computer and use it in GitHub Desktop.
Save debuti/a2329211febcd602cd90ea2cacae8fc3 to your computer and use it in GitHub Desktop.
Base64 multi-encoding/decoding script
#!/bin/bash
# Source this file
# The output length follows an expotential sequence, the same as the computation time
function bex { outstr=$1; incount=$2; while [[ ! incount -eq 0 ]]; do outstr=$(echo "$outstr" | base64 -w0); (( incount-- )); done; echo $outstr; }
function bdx { outstr=$1; incount=$2; while [[ ! incount -eq 0 ]]; do outstr=$(echo "$outstr" | base64 -d); (( incount-- )); done; echo $outstr; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment