WordPress at a glance
function is not described

ParagonIE_Sodium_Compat::crypto_generichash_final() public WP 1.0

Get the final BLAKE2b hash output for a given context.

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

No Hooks.

Return

String. Final BLAKE2b hash.

Usage

$result = ParagonIE_Sodium_Compat::crypto_generichash_final( $ctx, $length );
$ctx(string) (required)
BLAKE2 hashing context. Generated by crypto_generichash_init().
$length(int)
Hash output size.

Code of ParagonIE_Sodium_Compat::crypto_generichash_final() WP 5.7

<?php
public static function crypto_generichash_final(&$ctx, $length = self::CRYPTO_GENERICHASH_BYTES)
{
    /* Type checks: */
    ParagonIE_Sodium_Core_Util::declareScalarType($ctx, 'string', 1);
    ParagonIE_Sodium_Core_Util::declareScalarType($length, 'int', 2);

    if (self::useNewSodiumAPI()) {
        return sodium_crypto_generichash_final($ctx, $length);
    }
    if (self::use_fallback('crypto_generichash_final')) {
        $func = '\\Sodium\\crypto_generichash_final';
        return (string) $func($ctx, $length);
    }
    if ($length < 1) {
        try {
            self::memzero($ctx);
        } catch (SodiumException $ex) {
            unset($ctx);
        }
        return '';
    }
    if (PHP_INT_SIZE === 4) {
        $result = ParagonIE_Sodium_Crypto32::generichash_final($ctx, $length);
    } else {
        $result = ParagonIE_Sodium_Crypto::generichash_final($ctx, $length);
    }
    try {
        self::memzero($ctx);
    } catch (SodiumException $ex) {
        unset($ctx);
    }
    return $result;
}