Last active
June 19, 2020 05:53
-
-
Save roycewilliams/8f3bf8e3109f771b1b773265317c6c1c to your computer and use it in GitHub Desktop.
hexception
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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