in reply to Re: Creating custom hash of file
in thread Creating custom hash of file
I had to use bigint, which is sub-optimal in that it gets the correct results at the cost of vastly increased execution time.Only if you don't use an XS library to do the calculations. Math::BigInt supports several, including Bit::Vector (Math::BigInt::BitVect), Math::Pari (Math::BigInt::Pari), and Math::GMP (Math::BigInt::GMP).
Judging by the linked-to code, the hash is just summing the ASCII values of each byte.Hmm, I thought unpack supported braindead checksumming out of the box... something to do with a "%" sign, apparently. It might suffice to read a 64k block and apply unpack to it, with the proper format.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Creating custom hash of file
by Anno (Deacon) on Mar 18, 2007 at 19:47 UTC |