Skip to content

Instantly share code, notes, and snippets.

@Tester2009
Last active November 7, 2016 21:31
Show Gist options
  • Save Tester2009/3b02ba9cbe43b6aa9979f26c8101782e to your computer and use it in GitHub Desktop.
Save Tester2009/3b02ba9cbe43b6aa9979f26c8101782e to your computer and use it in GitHub Desktop.
Convert Text to Hexadecimal
# this code is written in terminal
# basically in .sh
# just chmod this file
# usage:
# chmod +x Text2hex.sh
# ./Text2hex.sh "this is my hexa"
# 74 68 69 73 20 69 73 20 6d 79 20 68 65 78 61
#
# source: http://stackoverflow.com/questions/6791798/convert-string-to-hexadecimal-on-command-line
echo -n $1 | od -A n -t x1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment