Perl6 module for federal documents validations
Perl 6
Switch branches/tags
Nothing to show
Clone or download
Latest commit ba6543a Sep 19, 2017


Build Status GitPitch


use Brazilian::FederalDocuments;

if FederalDocuments::CPF(number => 6931987887).is-valid {
    say "Valid CPF!!!"
} else {
    say "Invalid CPF..."

if FederalDocuments::CNPJ(number => 394411000109).is-valid {
    say "Valid CNPF!!!"
} else {
    say "Invalid CNPF..."


In Brazil, there are two numbers of documents used especially for financial transactions. For individuals, the CPF (Individual Persons Registry), and for companies, the CNPJ (National Registry of Legal Entities).

This module verifies that the numbers are valid.


This library is free software; you can redistribute it and/or modify it under the terms of the MIT License.