The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Math::BigSimple

VERSION

Version number is 1.1(this is the second BigSimple version). Looks stable.

It was written 12.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.

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.

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