PHP code example of rmrevin / yii2-xxtea
1. Go to this page and download the library: Download rmrevin/yii2-xxtea library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
rmrevin / yii2-xxtea example snippets
<?
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);