PHPackages                             helsinque/cpf-cnpj - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Validation &amp; Sanitization](/categories/validation)
4. /
5. helsinque/cpf-cnpj

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

helsinque/cpf-cnpj
==================

Validador para CPF e CNPJ agnóstico de framework

1.0.1(10y ago)1751[7 issues](https://github.com/helsinque/cpf_cnpj/issues)MITPHPPHP &gt;=5.6.4

Since Apr 10Pushed 8y ago2 watchersCompare

[ Source](https://github.com/helsinque/cpf_cnpj)[ Packagist](https://packagist.org/packages/helsinque/cpf-cnpj)[ RSS](/packages/helsinque-cpf-cnpj/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)DependenciesVersions (2)Used By (0)

cpf\_cnpj
=========

[](#cpf_cnpj)

===========================================

Validador PHP para CPF e CNPJ agnóstico de framework. É uma lib criada para uma validação simples de CPF e CNPJ.

- Valida CPF com ou sem máscara.
- Valida CNPJ com ou sem máscara.
- - Valida documento na Receita Federal através da API "bipbop.com.br"

TL;DR
-----

[](#tldr)

Um simples exemplo de validação de CNPJ e uma com a Bipbop apresetando o retorno da Receita:

Validações
----------

[](#validações)

```
require __DIR__ . '/vendor/autoload.php';

$validate = new Helsinque\Validator();

try {
    $result = $validate->validate("Cnpj", "42.183.878/0001-50");
} catch (\Exception $e) {
    echo $e->getMessage();
}

echo $result; //true
```

For BipBop info
---------------

[](#for-bipbop-info)

```
require __DIR__ . '/vendor/autoload.php';

$config = [
    'API_BIPBOP_KEY' => YOUR_KEY_HERE
];

$validate = new Helsinque\Validator($config);

try {
    $result = $validate->validate("BipBop", "42.183.878/0001-50");
} catch (\Exception $e) {
    echo $e->getMessage();
}

echo $result; //informações sobre o cnpj
```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 87.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3681d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/eaa7809c08b8dedd35db6b285c0611c19b73deecf208103e9976f684422bb25a?d=identicon)[helsinque](/maintainers/helsinque)

---

Top Contributors

[![helsinque](https://avatars.githubusercontent.com/u/7644786?v=4)](https://github.com/helsinque "helsinque (29 commits)")[![eduardogalbiati](https://avatars.githubusercontent.com/u/7586945?v=4)](https://github.com/eduardogalbiati "eduardogalbiati (3 commits)")[![lfamorim](https://avatars.githubusercontent.com/u/195014?v=4)](https://github.com/lfamorim "lfamorim (1 commits)")

### Embed Badge

![Health badge](/badges/helsinque-cpf-cnpj/health.svg)

```
[![Health](https://phpackages.com/badges/helsinque-cpf-cnpj/health.svg)](https://phpackages.com/packages/helsinque-cpf-cnpj)
```

###  Alternatives

[webmozart/assert

Assertions to validate method input/output with nice error messages.

7.6k894.0M1.2k](/packages/webmozart-assert)[bensampo/laravel-enum

Simple, extensible and powerful enumeration implementation for Laravel.

2.0k15.9M104](/packages/bensampo-laravel-enum)[swaggest/json-schema

High definition PHP structures with JSON-schema based validation

48612.5M73](/packages/swaggest-json-schema)[stevebauman/purify

An HTML Purifier / Sanitizer for Laravel

5325.6M19](/packages/stevebauman-purify)[ashallendesign/laravel-config-validator

A package for validating your Laravel app's config.

217905.3k5](/packages/ashallendesign-laravel-config-validator)[crazybooot/base64-validation

Laravel validators for base64 encoded files

1341.9M8](/packages/crazybooot-base64-validation)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
