Merge pull request #1983 from the-djmaze/pecl-xxtea

Add support for PECL xxtea
This commit is contained in:
RainLoop Team 2020-04-07 15:06:37 +03:00 committed by GitHub
commit b9899df934
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -31,6 +31,10 @@ class Crypt
return ''; return '';
} }
if (\is_callable('xxtea_encrypt')) {
return xxtea_encrypt($sString, $sKey);
}
$aV = self::str2long($sString, true); $aV = self::str2long($sString, true);
$aK = self::str2long($sKey, false); $aK = self::str2long($sKey, false);
if (\count($aK) < 4) if (\count($aK) < 4)
@ -80,6 +84,10 @@ class Crypt
return ''; return '';
} }
if (\is_callable('xxtea_decrypt')) {
return xxtea_decrypt($sEncriptedString, $sKey);
}
$aV = self::str2long($sEncriptedString, false); $aV = self::str2long($sEncriptedString, false);
$aK = self::str2long($sKey, false); $aK = self::str2long($sKey, false);