1. Go to this page and download the library: Download singra/br-validation library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
Cpf::generate(); // CSPRNG
$seeded = new Randomizer(new Xoshiro256StarStar(hash('sha256', 'seed', true)));
Cpf::generate($seeded)->value(); // '01326741225', every run
Cpf::generate(region: FiscalRegion::Eighth); // issued in São Paulo
Cep::generate(uf: Uf::PE); // inside a Pernambuco block
Cnpj::generate(alphanumeric: true); // 'K9.VWW.FYR/0001-34'
Cpf::isValid('11144477700'); // false
Cpf::mask('11144477700'); // '111.444.777-00'
Cpf::redact('11144477700'); // '***.444.777-**'
Cpf::mask('1234'); // throws — shape is still enforced
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.