sub bytearray_to_bigint { my @array = @_; my $base = Math::BigInt->new('1'); my $result = Math::BigInt->new('0'); foreach my $a (@array) { $result += $a * $base; $base *= 256; } return $result; }
In reply to Re: Converting an array of bytes into a BigInt - speed considerations
by pg
in thread Converting an array of bytes into a BigInt - speed considerations
by dempa
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |