/**
  * 解密函数
  * @param string $txt 待解密的字符串
  * @param string $key 解密密钥,默认读取SECURE_CODE配置
  * @return string 解密后的字符串
  */
 private function jiemi($txt, $key = null)
 {
     empty($key) && ($key = C('SECURE_CODE'));
     //有mcrypt扩展时
     if (function_exists('mcrypt_module_open')) {
         return desdecrypt($txt, $key);
     }
     //无mcrypt扩展时
     return tsauthcode($text, 'DECODE', $key);
 }
示例#2
0
function jiemi($text, $key = null)
{
    if (empty($key)) {
        $key = C('SECURE_CODE');
    }
    return tsauthcode($text, 'DECODE', $key);
}