PHP - Manual: sodium_compare
2024-11-13
(PHP 7 >= 7.2.0, PHP 8)
sodium_compare — Compare large numbers
$string1
, string $string2
): intCompare two strings as if they were arbitrary-length, unsigned little-endian integers, without side-channel leakage.
string1
Left operand
string2
Right operand
Returns -1
if string1
is less than string2
.
Returns 1
if string1
is greater than string2
.
Returns 0
if both strings are equal.
官方地址:https://www.php.net/manual/en/function.sodium-compare.php