ParagonIE_Sodium_Compat::memcmp

Advertisement

Summery Summery

Compare two strings.

Syntax Syntax

ParagonIE_Sodium_Compat::memcmp( string $left, string $right )

Parameters Parameters

$left

(Required)

$right

(Required)

Return Return

(int)

Source Source

File: wp-includes/sodium_compat/src/Compat.php

    public static function memcmp($left, $right)
    {
        /* Type checks: */
        ParagonIE_Sodium_Core_Util::declareScalarType($left, 'string', 1);
        ParagonIE_Sodium_Core_Util::declareScalarType($right, 'string', 2);

        if (self::useNewSodiumAPI()) {
            return sodium_memcmp($left, $right);
        }
        if (self::use_fallback('memcmp')) {
            return (int) call_user_func('\\Sodium\\memcmp', $left, $right);
        }
        /** @var string $left */
        /** @var string $right */
        return ParagonIE_Sodium_Core_Util::memcmp($left, $right);
    }

Advertisement

Advertisement

Leave a Reply