WordPress at a glance
function is not described

ParagonIE_Sodium_Crypto32::generichash() public WP 1.0

Calculate a BLAKE2b hash.

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

No Hooks.

Return

String. Null. Nothing.

Usage

$result = ParagonIE_Sodium_Crypto32::generichash( $message, $key, $outlen );
$message(string) (required)
-
$key *(string null)*
$outlen(int)
-

Code of ParagonIE_Sodium_Crypto32::generichash() WP 5.7

<?php
public static function generichash($message, $key = '', $outlen = 32)
{
    // This ensures that ParagonIE_Sodium_Core32_BLAKE2b::$iv is initialized
    ParagonIE_Sodium_Core32_BLAKE2b::pseudoConstructor();

    $k = null;
    if (!empty($key)) {
        /** @var SplFixedArray $k */
        $k = ParagonIE_Sodium_Core32_BLAKE2b::stringToSplFixedArray($key);
        if ($k->count() > ParagonIE_Sodium_Core32_BLAKE2b::KEYBYTES) {
            throw new RangeException('Invalid key size');
        }
    }

    /** @var SplFixedArray $in */
    $in = ParagonIE_Sodium_Core32_BLAKE2b::stringToSplFixedArray($message);

    /** @var SplFixedArray $ctx */
    $ctx = ParagonIE_Sodium_Core32_BLAKE2b::init($k, $outlen);
    ParagonIE_Sodium_Core32_BLAKE2b::update($ctx, $in, $in->count());

    /** @var SplFixedArray $out */
    $out = new SplFixedArray($outlen);
    $out = ParagonIE_Sodium_Core32_BLAKE2b::finish($ctx, $out);

    /** @var array<int, int> */
    $outArray = $out->toArray();
    return ParagonIE_Sodium_Core32_Util::intArrayToString($outArray);
}