ParagonIE_Sodium_Core_Util::xorStrings

Advertisement

Summery Summery

Calculate $a ^ $b for two strings.

Syntax Syntax

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

Parameters Parameters

$a

(string) (Required)

$b

(string) (Required)

Return Return

(string)

Source Source

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

    public static function xorStrings($a, $b)
    {
        /* Type checks: */
        if (!is_string($a)) {
            throw new TypeError('Argument 1 must be a string');
        }
        if (!is_string($b)) {
            throw new TypeError('Argument 2 must be a string');
        }

        return (string) ($a ^ $b);
    }

Advertisement

Advertisement

Leave a Reply

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