in reply to Bitwise AND with large numbers
Whilst Math::BigInt and similar arbitrary precision modules work for this, they leave a lot to be desired when it comes to performing fixed-precision math. As well as being dog slow, they don't round or truncate as fixed-precision does, and that can lead to the need for lots of extra work to 'fix' intermediate values in calculations.
If you have a lot of 128-bit integers (16-bytes/32-hex bytes) to manipulate, and need fixed precision semantics, then look at salva's Math::Int128 it is efficient and stable and provides the correct semantics for bitwise manipulations of 128-bit digests, hashes and similar.
|
|---|