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
In reply to Re: String to Hex
by BrowserUk
in thread String to Hex
by augustpete
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |