ductran / sensitive-filter
Detect & Hide sensitive data in string
v0.1.1-beta
2017-11-01 08:10 UTC
Requires
- php: >=5.5
Requires (Dev)
- phpunit/phpunit: ^4.0 || ^5.0
This package is not auto-updated.
Last update: 2024-11-10 02:29:54 UTC
README
Hide sensitive information in string
Installation
$ composer require ductran/sensitive-filter
Usage
use \Ductran\SensitiveFilter\Facades\SensitiveFilter;
Hide Email
$filter = new \Ductran\SensitiveFilter\SensitiveFilter(); $filter->addProcessor(new \Ductran\SensitiveFilter\EmailProcessor()); echo $filter->filter('duc@gmail.com adasd test@gmail.com');
Hide Id Card
$filter = new \Ductran\SensitiveFilter\SensitiveFilter(); $filter->addProcessor(new \Ductran\SensitiveFilter\IdCardProcessor()); echo $filter->filter('dadads2478-8339-3242-2423dsdsa2478-8339-3242-2424');
Hide string matching regex string
SensitiveFilter::on()->withRegex('/[0-9]{10}/')->withRegex('/([a-z0-9_-]{6,9})/')->filter('$$$^^^&[myp4ssw0rd] 0979306603');
Contributing
- Fork it!
- Create your feature branch:
$ git checkout -b feature/your-new-feature
- Commit your changes:
$ git commit -am 'Add some feature'
- Push to the branch:
$ git push origin feature/your-new-feature
- Submit a pull request.
License
MIT License