Add support for PECL xxtea

This commit is contained in:
djmaze 2020-03-20 16:14:36 +01:00
parent 15ceddc202
commit 2266affa5b

View file

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