rmrevin/yii2-xxtea

用于yii2加密算法XXTEA的扩展

安装: 275

依赖: 1

建议者: 0

安全: 0

星星: 6

观察者: 3

分支: 2

公开问题: 0

类型:yii2-extension

1.2.0 2014-08-05 09:27 UTC

This package is not auto-updated.

Last update: 2024-09-09 14:39:55 UTC


README

安装

composer.json

{
    "require": {
        "rmrevin/yii2-xxtea": "1.2.0"
    }
}

配置

/protected/config/main.php

<?
return array(
  // ...
	'components' => array(
		// ...
		'xxtea' => array(
			'class' => 'rmrevin\yii\xxtea\Component',
			'key' => 'qwertyuiopasdfgh', // 16 letters
			'base64_encode' => true,
		),
	),
	// ...
);

使用方法

<?
// ...
$XXTEA = \Yii::$app->get('xxtea');

$hash = $XXTEA->encrypt('data to encrypting');

$data = $XXTEA->decrypt($hash);