Number::Encode - Encode bit strings into digit strings
use Number::Encode qw(nonuniform uniform);
Provides a mechanism to convert arbitrary bit-strings into numeric digit strings. The transformation can be uniform or non-uniform depending on the type of distribution of the numeric digits achieved.
The former approach is useful for security-related applications such as calling cards and the such, which require a uniform digit distribution. The algorythm used to generate uniform distributions, while deterministic, is more constly than the non-uniform variant.
This module is distributed under the same terms and warranty as Perl itself.
This module provides the following exports:
my $number = nonuniform($data)
Converts a bit-string represented in the example by the scalar $data to a numeric string representation returned at $number.
$data
$number
The probabilistic distribution of the digits in the resulting number is not uniform. Some digits will have up to twice the chance of others of appearing at a given position.
my $number = uniform($data)
Performs a transformation from the bit-string provided in $data to a numeric string returned at $number. This transformation is a bit more costly but has the advantage that the digit distribution is uniform. This function is adequate for applications that require a uniform composition of the numeric strings, such as password or PIN number generators.
Original version; created by h2xs 1.20 with options
-ACOXfn Number::Encode -v 1.00
Luis E. Munoz <lem@cantv.net>
perl(1).
To install Number::Encode, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Number::Encode
CPAN shell
perl -MCPAN -e shell install Number::Encode
For more information on module installation, please visit the detailed CPAN module installation guide.