diff --git a/phpseclib/Common/Functions/Strings.php b/phpseclib/Common/Functions/Strings.php index ef7500e6..72cca8a9 100644 --- a/phpseclib/Common/Functions/Strings.php +++ b/phpseclib/Common/Functions/Strings.php @@ -378,6 +378,11 @@ abstract class Strings */ public static function increment_str(&$var) { + if (function_exists('sodium_increment')) { + sodium_increment($var); + return; + } + for ($i = 4; $i <= strlen($var); $i+= 4) { $temp = substr($var, -$i, 4); switch ($temp) {