zhenhao / smaz
Smaz 的 PHP 版本 - 一个短字符串压缩库
v1.1.1
2015-12-24 10:38 UTC
This package is auto-updated.
Last update: 2024-09-15 17:07:04 UTC
README
Smaz 的 PHP 版本 - 一个短字符串压缩库
php test.php
-50% http://www.baidu.com
-50% This is a small string
+9.09% THIS IS A SMALL STRING
-48.15% Nothing is more difficult, and therefore more precious, than to be able to decide
-45.24% http://github.com/antirez/smaz/tree/master
-15.38% 1000 numbers 2000 will 10 20 30 compress very little
+0% good
+25% luck
+7.41% 好好学习,天天向上
+2.9% 白日依山尽,黄河入海流,欲穷千里目,更上一层楼
通过 Composer 引入
1. composer require zhenhao/smaz
2. try...
<?php
include "vendor/autoload.php";
$str = 'http://www.baidu.com';
$x = Smaz::encode($str);
var_dump($x, strlen($x));
$t = Smaz::decode($x);
var_dump($t, strlen($t));