ParagonIE_Sodium_Core_Util::verify_32

Advertisement

Summery Summery

Compare a 32-character byte string in constant time.

Syntax Syntax

ParagonIE_Sodium_Core_Util::verify_32( string $a, string $b )

Parameters Parameters

$a

(Required)

$b

(Required)

Return Return

(bool)

Source Source

File: wp-includes/sodium_compat/src/Core/Util.php

    public static function verify_32($a, $b)
    {
        /* Type checks: */
        if (!is_string($a)) {
            throw new TypeError('String expected');
        }
        if (!is_string($b)) {
            throw new TypeError('String expected');
        }
        return self::hashEquals(
            self::substr($a, 0, 32),
            self::substr($b, 0, 32)
        );
    }

Advertisement

Advertisement

Leave a Reply