Skip to content

Instantly share code, notes, and snippets.

@00-matt
Created September 8, 2019 10:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 00-matt/cb0f12a8c11836693070585e3f802549 to your computer and use it in GitHub Desktop.
Save 00-matt/cb0f12a8c11836693070585e3f802549 to your computer and use it in GitHub Desktop.
#!/bin/sh
# IN: deadbeef
# OUT: \xde\xad\xbe\xef
hexify() {
echo "$1" | fold -w 2 | sed -e 's/^/\\x/' | paste -s -d ''
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment