url中id非规律性加密,跟youtube一样的逼格
1. 将类库放到项目的Application/Common/Util下面
2.再需要的地方调用,第一个参数任意密钥,第二个参数为生成字符串的长度
$hashids = new \Common\Util\Hashids('Your Keys', 12);
$ids = array(1,2,3);
// 加密
$str = $hashids->encode($ids);
// 解密
$ids = $hashids->decode($str);一席江南梦,烟雨醉心城,我是刺客!