fastwhale/yii2-aes
最新稳定版本:V1.0.1
Composer 安装命令:
composer require fastwhale/yii2-aes
包简介
Yii2 AES Encrypt&&Decrypt
关键字:
README 文档
README
Yii2 AES Encrypt && Decrypt
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist fastwhale/yii2-aes "*"
or add
"fastwhale/yii2-aes": "*"
to the require section of your composer.json file.
Usage
Aes init
'components' => [ ... 'aes' => [ 'class' => 'fastwhale\yii2\aes\Aes', 'key' => 'Y34lM1IyOSUTEa5h', // The encrypt & decrypt key. 'iv' => 'jKWFi17PZhpy08In', // A non-NULL Initialization Vector, default: 397e2eb61307109f. ] ... ] // Global Use $aesMcrypt = Yii::$app->aes; // More Use $aesMcrypt = Yii::createObject([ 'class' => 'fastwhale\yii2\aes\Aes', 'key' => 'Y34lM1IyOSUTEa5h', // The encrypt & decrypt key. 'iv' => 'jKWFi17PZhpy08In', // A non-NULL Initialization Vector, default: 397e2eb61307109f. ]);
Example:
$content = "hello world"; echo '<pre>' . PHP_EOL; echo 'mcrypt 加密:' . PHP_EOL; $aesMcrypt = Yii::$app->aes; var_dump($data = Yii::$app->aes->encrypt($content)); echo 'mcrypt 解密:' . PHP_EOL; var_dump(Yii::$app->aes->decrypt($data)); echo '</pre>'. PHP_EOL;
统计信息
- 总下载量: 62
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-08-31