Subject: | Optionally use Math::BigInt to protect from possible overflows |
Hi,
Excellent module, I actually use a homegrown version that looks 95% like
yours. Great minds think alike <grin>. What I found when using my
version was that in decrypt() I'd need to check what is the rough
projected size of $integer, based on the length of $encrypted and
$self->{len}. What I did is set up some thresholds* and if I think I
will go over I would make $integer a Math::BigInt->new (0) object, so I
can accomodate arbitrary values (I have 30-digit id numbers in the
wild). From there on the code is identical.
Unfortunately I can't share those with you, as in a later version I just
ripped the approximation out and started using BigInt exclusively. Was
too lazy to actually get it right.
Cheers