ParagonIE_Sodium_Core_Util::verify_16

Advertisement

Summery Summery

Compare a 16-character byte string in constant time.

Syntax Syntax

ParagonIE_Sodium_Core_Util::verify_16( 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_16($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, 16),
            self::substr($b, 0, 16)
        );
    }

Advertisement

Advertisement

Leave a Reply