PHP code example of 4slv / xxtea
1. Go to this page and download the library: Download 4slv/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/ */
4slv / xxtea example snippets
use xxtea\Xxtea;
$str = "Hello World!";
$key = "1234567890";
$encrypt_data = Xxtea::encrypt($str, $key);
$decrypt_data = Xxtea::decrypt($encrypt_data, $key);
if ($str == $decrypt_data) {
echo "success!";
} else {
echo "fail!";
}