PHPackages                             rcngo/cpfcnpj - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. rcngo/cpfcnpj

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

rcngo/cpfcnpj
=============

Cpf or Cnpj Functions

1.0.6(5y ago)07MITPHPPHP 7.\* || 8.\*

Since Aug 20Pushed 5y ago1 watchersCompare

[ Source](https://github.com/rcngo/cpfcnpj)[ Packagist](https://packagist.org/packages/rcngo/cpfcnpj)[ RSS](/packages/rcngo-cpfcnpj/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (3)Versions (7)Used By (0)

Validate CPF and CNPJ, remove and include mask.
===============================================

[](#validate-cpf-and-cnpj-remove-and-include-mask)

Installation / Configuration
----------------------------

[](#installation--configuration)

Navigate to your project folder, for example:

```
cd /etc/www/projeto

```

And then run:

```
composer require rcngo/cpfcnpj:1.0.* --no-scripts

```

Or add it to the composer.json file, add it to your "require" :, example:

```
{
    "require": {
        "rcngo/cpfcnpj": "1.0.*"
    }
}
```

Run the composer update --no-scripts command.

Use
---

[](#use)

```
cnpfcnpj::removeMaskCpfOrCnpj('000.000.000-00');
// return cpf string 00000000000

cnpfcnpj::removeMaskCpfOrCnpj('00.000.000/0000-00');
// return cnpj string 00000000000000

cnpfcnpj::maskCpfOrCnpj('00000000000');
// return cpf string 000.000.000-00

cnpfcnpj::maskCpfOrCnpj('00000000000000');
// return cnpj string 00.000.000/0000-00

cnpfcnpj::cpfValidate('000.000.000-00');
// return true or false

cnpfcnpj::cnpjValidate('00.000.000/0000-00');
// return true or false
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Every ~0 days

Total

6

Last Release

2088d ago

PHP version history (2 changes)1.0.0PHP ^7.2.5

1.0.5PHP 7.\* || 8.\*

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/17250811?v=4)[Rafael Cruz Nascimento](/maintainers/rcngo)[@rcngo](https://github.com/rcngo)

---

Top Contributors

[![rcngo](https://avatars.githubusercontent.com/u/17250811?v=4)](https://github.com/rcngo "rcngo (8 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/rcngo-cpfcnpj/health.svg)

```
[![Health](https://phpackages.com/badges/rcngo-cpfcnpj/health.svg)](https://phpackages.com/packages/rcngo-cpfcnpj)
```

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M685](/packages/barryvdh-laravel-ide-helper)[orchestra/canvas

Code Generators for Laravel Applications and Packages

21017.2M157](/packages/orchestra-canvas)[illuminate/pipeline

The Illuminate Pipeline package.

9446.6M210](/packages/illuminate-pipeline)[illuminate/pagination

The Illuminate Pagination package.

10532.5M858](/packages/illuminate-pagination)[spatie/laravel-pjax

A pjax middleware for Laravel 5

513371.8k11](/packages/spatie-laravel-pjax)[spatie/laravel-mix-preload

Add preload and prefetch links based your Mix manifest

169176.0k2](/packages/spatie-laravel-mix-preload)

PHPackages © 2026

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