首页 话题 小组 问答 好文 用户 我的社区 域名交易 唠叨

[函数]hash_hmac_algos()函数—用法及示例

发布于 2025-04-27 08:42:06
0
29

函数名:hash_hmac_algos()

适用版本:PHP 5 >= 5.1.2, PHP 7, PHP 8

用法:hash_hmac_algos() 函数返回当前系统支持的所有哈希算法的名称,这些算法可以用于 hash_hmac() 函数进行消息认证码计算。

语法:hash_hmac_algos(): array

示例:

<?php
// 获取系统支持的哈希算法
$algos = hash_hmac_algos();

// 打印支持的算法列表
foreach ($algos as $algo) {
    echo $algo . PHP_EOL;
}
?>

输出:

md2
md4
md5
sha1
sha224
sha256
sha384
sha512
ripemd128
ripemd160
ripemd256
ripemd320
whirlpool
tiger128,3
tiger160,3
tiger192,3
tiger128,4
tiger160,4
tiger192,4
snefru
gost
adler32
crc32
crc32b
salsa10
salsa20
haval128,3
haval160,3
haval192,3
haval224,3
haval256,3
haval128,4
haval160,4
haval192,4
haval224,4
haval256,4
haval128,5
haval160,5
haval192,5
haval224,5
haval256,5

注意:具体支持的算法列表可能因PHP版本和系统环境而有所不同。

评论
一个月内的热帖推荐
啊龙
Lv.1普通用户

9545

帖子

31

小组

3242

积分

赞助商广告
站长交流