|
CheckDigits::M11_003 - compute check digits for PKZ |
CheckDigits::M11_003 - compute check digits for PKZ (GDR)
use CheckDigits;
$pkz = CheckDigits('pkz');
if ($pkz->is_valid('150765400354')) {
# do something
}
$cn = $pkz->complete('15076540035');
# $cn = '150765400354'
$cd = $pkz->checkdigit('150765400354');
# $cd = '4'
$bn = $pkz->basenumber('150765400354');
# $bn = '150765400354'
=head1 DESCRIPTION
To validate a PKZ apply steps 2 to 4 to the complete number.
is_valid($number)$number consists solely of numbers and the last digit
is a valid check digit according to the algorithm given above.
Returns false otherwise,
complete($number)$number is computed and concatenated to the end
of $number.
Returns the complete number with check digit or '' if $number
does not consist solely of digits and spaces.
basenumber($number)$number if $number has a valid check
digit.
Return '' otherwise.
checkdigit($number)$number if $number has a valid check
digit.
Return '' otherwise.
None by default.
Mathias Weidner, <mathias@weidner.in-bad-schmiedeberg.de>
the perl manpage, the CheckDigits manpage, www.pruefziffernberechnung.de.
|
CheckDigits::M11_003 - compute check digits for PKZ |