Skip to content

Instantly share code, notes, and snippets.

@ilosamart
Created June 16, 2021 14:58
Show Gist options
  • Save ilosamart/a11f56dc360c0738e45a98a963f8b8f6 to your computer and use it in GitHub Desktop.
Save ilosamart/a11f56dc360c0738e45a98a963f8b8f6 to your computer and use it in GitHub Desktop.
Encode / Decode text - ideia ctrl-chupada descaradamente do linkedin do João
# ref.: https://unix.stackexchange.com/questions/98948/ascii-to-binary-and-binary-to-ascii-conversion-tools
#decode
echo "$@" | base64 -d | zcat | perl -lape '$_=pack"(B8)*",@F'
# ref.: https://unix.stackexchange.com/questions/98948/ascii-to-binary-and-binary-to-ascii-conversion-tools
# encode
echo "$@" | perl -lpe '$_=join " ", unpack"(B8)*"' | gzip -c | base64 -w0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment