Skip Menu |

This queue is for tickets about the Integer-Tiny CPAN distribution.

Report information
The Basics
Id: 43231
Status: resolved
Priority: 0/
Queue: Integer-Tiny

People
Owner: BBKR [...] cpan.org
Requestors: ribasushi [...] leporine.io
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.1
Fixed in: (no value)



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
Version 0.3 uses Math::BigInt infinite precision. Thanks for your report.