Algorithm-CheckDigits

 view release on metacpan or  search on metacpan

lib/Algorithm/CheckDigits/MBase_001.pm  view on Meta::CPAN

If the sum from step 4 is 0 modulo 10, the check digit is 0. Else the
check digit is 10 minus the sum from step 4 taken modulo 10.

=back

=head2 METHODS

=over 4

=item is_valid($number)

Returns true only if C<$number> consists solely of numbers and the last digit
is a valid check digit according to the algorithm given above.

Returns false otherwise,

=item complete($number)

The check digit for C<$number> is computed and concatenated to the end
of C<$number>.

Returns the complete number with check digit or '' if C<$number>
does not consist solely of digits and spaces.

=item basenumber($number)

Returns the basenumber of C<$number> if C<$number> has a valid check
digit.

Return '' otherwise.

=item checkdigit($number)

Returns the checkdigit of C<$number> if C<$number> has a valid check
digit.

Return '' otherwise.

=back

=head2 EXPORT

None by default.

=head1 AUTHOR

Mathias Weidner, C<< <mamawe@cpan.org> >>

=head1 THANKS

Aaron W. West pointed me to a fault in the computing of the check
digit.

=head1 SEE ALSO

L<perl>,
L<CheckDigits>,
F<www.pruefziffernberechnung.de>,
F<www.export911.com/e911/coding/upcChar.htm>,
F<www.adams1.com/pub/russadam/upccode.html>,
F<http://www.upcdatabase.com>.

=cut



( run in 0.857 second using v1.01-cache-2.11-cpan-6b5c3043376 )