« sodium_crypto_core_ristretto255_sub
sodium_crypto_generichash_final »

sodium_crypto_generichash

(PHP 7 >= 7.2.0, PHP 8)

sodium_crypto_generichash — メッセージのハッシュ値を得る

説明

function sodium_crypto_generichash(string $message, #[\SensitiveParameter] string $key = "", int $length = SODIUM_CRYPTO_GENERICHASH_BYTES): string

BLAKE2b を使い、メッセージをハッシュ化します。

パラメータ

message

ハッシュ化するメッセージ

key

(オプション)暗号キー。 この値は、HMACキーと同じ役割を果たしますが、 内部的な BLAKE2 のステートの予約されたセクションに統合されています。

length

出力の長さ

戻り値

ハッシュ値を生のバイトとして返します。 16進エンコードしたい場合、 この関数の結果を sodium_bin2hex() に渡すことができます。

関連キーワード:
sodium   メッセージ   crypto   ハッシュ   generichash   message   length   ハッシュ化   キー   core   ristretto   final   Sodium   SensitiveParameter   暗号   役割   内部的   ステート   予約   セクション   統合   バイト   エンコード
関連する関数・ページ:
function.sodium-crypto-generichash-update   function.sodium-crypto-generichash-final   function.sodium-crypto-generichash-init   function.sodium-crypto-generichash-keygen   function.sodium-crypto-shorthash   function.sodium-crypto-sign