dillchuk / email-blur
A library to e-mail blur
2.0.0
2023-02-07 19:20 UTC
Requires
- php: >=8.0
Requires (Dev)
- league/csv: ^9.8
- phpunit/phpunit: ^9.5
README
This is version 2, derived from wobeto/email-blur
.
To install via composer, run:
# composer require dillchuk/email-blur
# composer install
Use with default mask:
<?php include 'vendor/autoload.php'; use Wobeto\EmailBlur\Blur; $blur = new Blur(); $obscured = $blur->make('example@test.com'); var_dump($obscured); // exa***@t***.com
Use with mask changed:
$blur = new Blur(mask: '<REDACTED>'); $obscured = $blur->make('example@test.com'); var_dump($obscured); // exa<REDACTED>@t<REDACTED>.com
Handles free email providers:
$blur = new Blur(); $obscured = $blur->make('example@gmail.com'); var_dump($obscured); // exa***@gmail.com $blur = new Blur(maskFree: true); $obscured = $blur->make('example@gmail.com'); var_dump($obscured); // exa***@gm***.com
Handles second-level domains:
$blur = new Blur(); $obscured = $blur->make('example@example.co.uk'); var_dump($obscured); // exa***@exa***.co.uk
See additional configuration options in the constructor.
mask
maskDomain
maskFree