The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Math::BigSimple

VERSION

Version number is 1.1a. Looks stable.

This is 1.1 version with improved test 3, written 13.06.2005.

DESCRIPTION

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.

SYNTAX

 # 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

FUNCTIONS

OOP interface

new(@params)

$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).

make

$simple_number = $generator->make();

Returns number as specified in $generator.

Procedure interface

is_simple($number)

$if_is_simple = is_simple($number);

Returns 1 if $number is simple. Don't use with small numbers.

make_simple

$simple_number = make_simple($length);

Returns a simple number of specified length. This is really the easiest way to get it.

LIMITATIONS

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.

AUTHOR

 Edward Chernenko <edwardspec@yahoo.com>.
 Perl programmer & Linux system administrator.

COPYRIGHT

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.

LOOK ALSO

Math::BigInt