Download the PHP package snowmannunu/mask-cn without Composer

On this page you can find all versions of the php package snowmannunu/mask-cn. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package mask-cn

mask-cn

中文本土场景敏感数据脱敏库 - 开箱即用,无需配置

Tests Latest Stable Version Total Downloads

安装

要求:PHP 7.3+ / 8.0+ / 8.1+ / 8.2+ / 8.3+,需要 ext-mbstring。

用法

基础脱敏

证件/机构代码脱敏

地址脱敏

自定义脱敏规则

实现 StrategyInterface 并注册即可使用:

注册后的策略同样支持 Mask::array() 批量脱敏:

数组批量脱敏

长文本智能识别(auto 模式)

Auto 内置识别类型:

类型 示例 说明
idCard 110101199003078888 18位身份证
phone 13812345678 大陆手机号
email [email protected] 邮箱
plate 京A12345 中国车牌(含新能源)
taiwanId A123456789 台湾身份证/居住证
hkMoPass H12345678 港澳回乡证
passport E12345678 护照
uscc 91110105MA00XXXXXX 统一社会信用代码(18位)
bankCard 6222021234567890123 银行卡(16-19位)

全局配置

通过 Config 类可统一设置默认掩码字符,无需在每个调用处重复传入:

优先级: 方法级 options['char'] > Config::get('char') > 默认 *。

PSR-3 Logger 集成

自动在日志输出前脱敏敏感字段,无需改动业务代码:

也可在任意日志框架中使用静态处理器:

自定义掩码字符

所有方法均支持 char 选项:

Laravel 集成

服务提供者已通过 extra.laravel.providers 自动注册,无需手动配置。

也可作为验证规则使用(可选):

支持的验证类型: phone、idCard、email、bankCard、name、plate、uscc、hkMoPass、taiwanId、passport、address。

测试

路线图

License

MIT


All versions of mask-cn with dependencies

PHP Build Version
Package Version
Requires php Version ^7.3 || ^8.0
ext-mbstring Version *
psr/log Version ^1.0 || ^2.0 || ^3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package snowmannunu/mask-cn contains the following files

Loading the files please wait ...