array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'de', ), 'this' => array ( 0 => 'function.sodium-crypto-generichash.php', 1 => 'sodium_crypto_generichash', ), 'up' => array ( 0 => 'ref.sodium.php', 1 => 'Sodium Funktionen', ), 'prev' => array ( 0 => 'function.sodium-crypto-generichash-update.php', 1 => 'sodium_crypto_generichash_update', ), 'next' => array ( 0 => 'function.sodium-crypto-kdf-derive-from-key.php', 1 => 'sodium_crypto_kdf_derive_from_key', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/sodium/functions/sodium-crypto-generichash.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 7 >= 7.2.0, PHP 8)
sodium_crypto_generichash — Get a hash of the message
$message
, string $key
= "", int $length
= SODIUM_CRYPTO_GENERICHASH_BYTES
): stringHash a message with BLAKE2b.
message
The message being hashed.
key
(Optional) cryptographic key. This serves the same function as a HMAC key, but it's utilized as a reserved section of the internal BLAKE2 state.
length
Output size.
The cryptographic hash as raw bytes. If a hex-encoded output is desired, the result can be passed to sodium_bin2hex().