firecms-ext / crypt
hyperf 扩展:字符串加密和机密
dev-master
2022-09-02 05:06 UTC
Requires
- php: >=8.0
- ext-openssl: *
- hyperf/command: ~v2.0
- hyperf/di: ~v2.0
- hyperf/framework: ~v2.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.0
- mockery/mockery: ^1.0
- phpstan/phpstan: ^1.0
- phpunit/phpunit: >=7.0
- swoole/ide-helper: ^4.5
Suggests
- swow/swow: Required to create swow components.
This package is auto-updated.
Last update: 2025-02-20 21:34:26 UTC
README
# 添加依赖 composer require firecms-ext/crypt # 发布配置 php bin/hyperf.php vendor:publish firecms-ext/crypt # 生成密钥 php bin/hyperf.php gen:app-key
函数列表
# 加密 function encrypt(mixed $value, bool $serialize = true): string # 解密 function decrypt(string $payload, bool $unserialize = true): mixed # 加密字符串 function encryptString(mixed $value): string # 解密字符串 function decryptString(string $payload): string