http://www.perlmonks.org?node_id=616875


in reply to String to Hex

For numbers upto 2**53 (~16 decimal digits), you could use this:

sub hexFromI53{ my $n = shift; my $lo = $n % ( 2**32 ); my $hi = int( $n / 2**32 ); return sprintf "%x%08x", $hi, $lo; };; print hexFromI53( 24600988483 );; 5ba554b43 print hexFromI53( 9_007_199_254_740_992 );; 20000000000000

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.