2017/01/02

Perl script to convert to x Based String


#/usr/bin/perl

use strict;
use warnings;
use constant DIV => 24;


my $v = shift or die "Usage: $0 ";

my $d = 0;
my $str = '';

do {
    my $c = chr(ord('A') + ($v % DIV));
    $str = $c . $str;
    $v = int($v / DIV)
} while ($v > 0);

print $str;

0;

BlockChain 相关电子书

@copyright of Sam Chadwick   - https://thehub.thomsonreuters.com/groups/bitcoin/blog/2017/09/10/blockchain-paper Blockchain Papers A c...