| Algorithm::CheckDigits::M11_004(3pm) | User Contributed Perl Documentation | Algorithm::CheckDigits::M11_004(3pm) |
CheckDigits::M11_004 - compute check digits for CPF (BR), Titulo 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, "<mamawe@cpan.org>"
perl, CheckDigits, www.pruefziffernberechnung.de.
| 2022-10-13 | perl v5.36.0 |