WordPress at a glance
function is not described

ParagonIE_Sodium_Core_Util::compare() public WP 1.0

Compares two strings.

{} It's a method of the class: ParagonIE_Sodium_Core_Util{}

No Hooks.

Return

Int. Null. Nothing.

Usage

$result = ParagonIE_Sodium_Core_Util::compare( $left, $right, $len );
$left(string) (required)
-
$right(string) (required)
-
$len(int)
-

Code of ParagonIE_Sodium_Core_Util::compare() WP 5.7

<?php
public static function compare($left, $right, $len = null)
{
    $leftLen = self::strlen($left);
    $rightLen = self::strlen($right);
    if ($len === null) {
        $len = max($leftLen, $rightLen);
        $left = str_pad($left, $len, "\x00", STR_PAD_RIGHT);
        $right = str_pad($right, $len, "\x00", STR_PAD_RIGHT);
    }

    $gt = 0;
    $eq = 1;
    $i = $len;
    while ($i !== 0) {
        --$i;
        $gt |= ((self::chrToInt($right[$i]) - self::chrToInt($left[$i])) >> 8) & $eq;
        $eq &= ((self::chrToInt($right[$i]) ^ self::chrToInt($left[$i])) - 1) >> 8;
    }
    return ($gt + $gt + $eq) - 1;
}