PHPackages                             jakson-fischer/lgpd - 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. jakson-fischer/lgpd

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

jakson-fischer/lgpd
===================

Classe para mascarar dados pessoais conforme LGPD

v1.0.2(1y ago)010MITPHPPHP &gt;=7.4

Since Oct 1Pushed 1y ago1 watchersCompare

[ Source](https://github.com/jaksfischer/Lgpd)[ Packagist](https://packagist.org/packages/jakson-fischer/lgpd)[ RSS](/packages/jakson-fischer-lgpd/feed)WikiDiscussions main Synced 1mo ago

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

LgpdMask
========

[](#lgpdmask)

Descrição pt-Br
---------------

[](#descrição-pt-br)

A classe `LgpdMask` foi desenvolvida para mascarar dados pessoais, em conformidade com a **LGPD (Lei Geral de Proteção de Dados)**, baseada na **GDPR**. Ela pode ser usada para ocultar informações sensíveis, como nome, CPF, RG, telefone, e-mail e data de nascimento, deixando apenas partes visíveis para proteger a privacidade dos usuários.

Description En
--------------

[](#description-en)

The `LgpdMask` class is designed to mask personal data, in compliance with **LGPD (Lei Geral de Proteção de Dados)**, which is based on **GDPR**. It can be used to hide sensitive information such as name, CPF, RG, phone number, email, and date of birth, leaving only parts visible to protect user privacy.

Instalação
----------

[](#instalação)

Instale via [Composer](https://getcomposer.org/):

```
composer require jakson-fischer/lgpd-mask
```

Installation
------------

[](#installation)

Install via [Composer](https://getcomposer.org/):

```
composer require jakson-fischer/lgpd-mask
```

Métodos Disponíveis
-------------------

[](#métodos-disponíveis)

Available Methods
-----------------

[](#available-methods)

### 1. `maskName($fullName)`

[](#1-masknamefullname)

Mascarar o nome completo, exibindo apenas o primeiro nome. Mask the full name, displaying only the first name.

#### Exemplo:

[](#exemplo)

```
LgpdMask::maskName('Carlos Eduardo Silva');
```

**Entrada**: `"Carlos Eduardo Silva"`**Saída**: `"Carlos ****** *****"`

### 2. `maskCpf($cpf)`

[](#2-maskcpfcpf)

Mascarar um CPF, exibindo apenas os três primeiros dígitos. Mask a CPF, displaying only the first three digits.

#### Exemplo:

[](#exemplo-1)

```
LgpdMask::maskCpf('123.456.789-00');
```

**Entrada**: `"123.456.789-00"`**Saída**: `"123.***.***-**"`

### 3. `maskRg($rg)`

[](#3-maskrgrg)

Mascarar um RG, exibindo apenas os três primeiros dígitos. Mask an RG, displaying only the first three digits.

#### Exemplo:

[](#exemplo-2)

```
LgpdMask::maskRg('12345678-9');
```

**Entrada**: `"12345678-9"`**Saída**: `"123*****-*"`

### 4. `maskEmail($email)`

[](#4-maskemailemail)

Mascarar um e-mail, exibindo apenas os três primeiros caracteres do e-mail e o domínio final (.com ou .com.br). Mask an email address, showing only the first three characters of the email and the final domain (.com or .com.br).

#### Exemplo:

[](#exemplo-3)

```
LgpdMask::maskEmail('exemplo-email@gmail.com');
```

**Entrada**: `"exemplo-email@gmail.com"`**Saída**: `"exe*********@****.com"`

### 5. `maskPhone($phone)`

[](#5-maskphonephone)

Mascarar um número de telefone, exibindo apenas os últimos quatro dígitos, preservando caracteres especiais como `()`, `.` e `-`. Mask a phone number, showing only the last four digits, while preserving special characters like `()`, `.`, and `-`.

#### Exemplo:

[](#exemplo-4)

```
LgpdMask::maskPhone('(11) 98765-4321');
```

**Entrada**: `"(11) 98765-4321"`**Saída**: `"(**) *****-4321"`

### 6. `maskDateOfBirth($birthDate)`

[](#6-maskdateofbirthbirthdate)

Mascarar uma data de nascimento, preservando os caracteres `/` ou `-`. Mask a date of birth, while preserving `/` or `-` characters.

#### Exemplo:

[](#exemplo-5)

```
LgpdMask::maskDateOfBirth('15/08/1990');
```

**Entrada**: `"15/08/1990"`**Saída**: `"**/**/****"`

Uso
---

[](#uso)

Veja o exemplo de uso abaixo no arquivo `index.php`.

License
-------

[](#license)

MIT

Usage
-----

[](#usage)

See the usage example below in the `index.php` file.

License
-------

[](#license-1)

MIT

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance36

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity40

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

2

Last Release

588d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/279877500b0cdaa35b31a8ed57861ede12f6340467900e68435b2522b5738f36?d=identicon)[jaksfischer](/maintainers/jaksfischer)

---

Top Contributors

[![jaksfischer](https://avatars.githubusercontent.com/u/29047674?v=4)](https://github.com/jaksfischer "jaksfischer (6 commits)")

---

Tags

phplgpdformater

### Embed Badge

![Health badge](/badges/jakson-fischer-lgpd/health.svg)

```
[![Health](https://phpackages.com/badges/jakson-fischer-lgpd/health.svg)](https://phpackages.com/packages/jakson-fischer-lgpd)
```

###  Alternatives

[imanghafoori/laravel-anypass

A minimal yet powerful package to help you in development.

21421.6k](/packages/imanghafoori-laravel-anypass)

PHPackages © 2026

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