Skip to content

Instantly share code, notes, and snippets.

@selftaught selftaught/raddr Secret
Created Dec 21, 2017

Embed
What would you like to do?
#!/usr/bin/env perl
use 5.010;
use strict;
use warnings;
use Getopt::Long;
my $address;
GetOptions('a|address=s' => \$address);
if ($address) {
my $len;
my @bytes = split('', $address);
if (($len = length $address) == 10 &&
$bytes[0] eq '0' && lc $bytes[1] eq 'x') {
$address = substr $address, 2, $len;
}
say '\x' . join ('\x', reverse ($address =~ m/../g));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.