- LOOK ALSO
Version number is 1.1a. Looks stable.
This is 1.1 version with improved test 3, written 13.06.2005.
The Math::BigSimple module can generate big simple numbers; it's very usefull for cryptographic programs which follow the open key principles(like RSA, IDEA, PGP and others). It's interface is VERY easy to use and it works enough fast even for the real-time applications.
# OOP interface use Math::BigSimple; $bs = Math::BigSimple->new(8); # Constructor $bs = Math::BigSimple->new(Length => 8, Checks => 5); # Old style $simple = $bs->make(); # Generation # Procedure interface. use Math::BigSimple qw(is_simple make_simple); print "SIMPLE!!!" if(is_simple(84637238096) == 1); # Test number $simple_number = make_simple($length); # Easy generation
$generator = Math::BigSimple->new(@options);
Initializes number generator; first parameter is required number length and optional second is number of validation checks (default 4). Also supported old format of params(1.0) - the hash with 'Length' and 'Checks' elements (don't use it).
$simple_number = $generator->make();
Returns number as specified in $generator.
$if_is_simple = is_simple($number);
Returns 1 if $number is simple. Don't use with small numbers.
$simple_number = make_simple($length);
Returns a simple number of specified length. This is really the easiest way to get it.
Generation of number with 15 or more digits is slow.
Number 2 won't be recognized as simple.
Some small numbers (for example, 3 and 7) not always pass the test.
Edward Chernenko <email@example.com>. Perl programmer & Linux system administrator.
Copyright (C)Edward Chernenko. This program is protected by Artistic License and can be used and/or distributed by the same rules as perl interpreter. All right reserved.