Skip to content

Instantly share code, notes, and snippets.

@roycewilliams
Last active June 19, 2020 05:53
Show Gist options
  • Save roycewilliams/8f3bf8e3109f771b1b773265317c6c1c to your computer and use it in GitHub Desktop.
Save roycewilliams/8f3bf8e3109f771b1b773265317c6c1c to your computer and use it in GitHub Desktop.
hexception
#!/usr/bin/env perl
# Created: 2017-08-13
# Author: Royce Williams / tychotithonus
# License: public domain
while (<>) {
chomp;
# Convert input to $HEX[] notation
my $hex = '$HEX[' . unpack("H*", $_) . ']' . "\n";
# Convert HEX notation to hex ... again (hexception!)
print unpack("H*", $hex) . "\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment