diff options
Diffstat (limited to 'hex2block.pl')
-rw-r--r-- | hex2block.pl | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/hex2block.pl b/hex2block.pl new file mode 100644 index 0000000..2dd90ed --- /dev/null +++ b/hex2block.pl @@ -0,0 +1,12 @@ +#!/usr/bin/perl -w + +$_ = <>; +chomp; +for(split /, */, $_) { + s/, *//; + s/0x//; + my $out = sprintf("%08b", hex($_)); + $out =~ s/1/X/g; + $out =~ s/0/ /g; + print "$out\n"; +} |