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

(string) (Required)

$b

(string) (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

This site uses Akismet to reduce spam. Learn how your comment data is processed.