| CheckDigits::M11_004(3pm) | User Contributed Perl Documentation | CheckDigits::M11_004(3pm) |
CheckDigits::M11_004 - compute check digits for CPF (BR), Título Eleitoral (BR)
use Algorithm::CheckDigits;
$cpf = CheckDigits('cpf');
if ($cpf->is_valid('043.033.407-90')) {
# do something
}
$cn = $cpf->complete('043.033.407-');
# $cn = '043.033.407-90'
$cd = $cpf->checkdigit('043.033.407-90');
# $cd = '90'
$bn = $cpf->basenumber('043.033.407-90');
# $bn = '043.033.407-'
a) If the result is 0 or 1 the checkdigit is 0
b) otherwise the checkdigit is 11 minus the result.
Returns false otherwise,
Returns the complete number with check digit or '' if $number does not consist solely of digits and spaces.
Return '' otherwise.
Return '' otherwise.
None by default.
Mathias Weidner, <mathias@weidner.in-bad-schmiedeberg.de>
perl, CheckDigits, www.pruefziffernberechnung.de.
Hey! The above document had some coding errors, which are explained below:
| 2021-01-03 | perl v5.32.0 |