use strict; use warnings; use Math::BigInt; use Digest::SHA qw(sha256_hex); for(my $i=1;$i<=10;$i++){ # the sha as a hex string (no '0x' prepended) my $hexstr = sha256_hex($i); # to create a bigint from a hex string we need to prepend '0x' to it my $digest = Math::BigInt->new('0x'.$hexstr); # operate print "$i $digest\n"; $digest /= 64; print "$i $digest\n"; }