[MENU] | |||||||||
[THOUGHTS] | [TECH RESOURCES] | [TRASH TALK] | |||||||
[DANK MEMES] | [FEATURED ARTISTS] | [W] |
This script will reverse your address and gives back in \xbla\xbla format.
Credits goes to selftaught!
- #!/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));
- }