略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: sodium_crypto_generichash

2024-12-19

sodium_crypto_generichash

(PHP 7 >= 7.2.0, PHP 8)

sodium_crypto_generichashGet a hash of the message

说明

sodium_crypto_generichash(string $message, string $key = "", int $length = SODIUM_CRYPTO_GENERICHASH_BYTES): string

Hash 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().

add a noteadd a note

User Contributed Notes

There are no user contributed notes for this page.

官方地址:https://www.php.net/manual/en/function.sodium-crypto-generichash.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3