📅  最后修改于: 2023-12-03 15:18:23.684000             🧑  作者: Mango
hash_hmac_algos()
函数是PHP的内置函数之一。该函数返回当前环境下可用的哈希算法列表。
hash_hmac_algos(): array
无需输入参数。
该函数返回一个数组,其中包含当前环境下可用的哈希算法列表。
您可以使用该函数来确定您的服务器上可用的哈希算法,例如:
$algos = hash_hmac_algos();
print_r($algos);
上述代码将返回所有可用的哈希算法的列表。
Array
(
[0] => sha224
[1] => sha256
[2] => sha384
[3] => sha512/224
[4] => sha512/256
[5] => sha512
[6] => sha3-224
[7] => sha3-256
[8] => sha3-384
[9] => sha3-512
[10] => ripemd128
[11] => ripemd160
[12] => ripemd256
[13] => ripemd320
[14] => whirlpool
[15] => tiger128,3
[16] => tiger160,3
[17] => tiger192,3
[18] => tiger128,4
[19] => tiger160,4
[20] => tiger192,4
[21] => snefru
[22] => snefru256
[23] => gost
[24] => gost-crypto
[25] => adler32
[26] => crc32
[27] => crc32b
[28] => fnv132
[29] => fnv164
[30] => joaat
[31] => haval128,3
[32] => haval160,3
[33] => haval192,3
[34] => haval224,3
[35] => haval256,3
[36] => haval128,4
[37] => haval160,4
[38] => haval192,4
[39] => haval224,4
[40] => haval256,4
[41] => haval128,5
[42] => haval160,5
[43] => haval192,5
[44] => haval224,5
[45] => haval256,5
)
本文中的代码示例是在PHP 7.4.3环境中测试并运行的。由于版本不同,代码在您的环境中可能会产生不同的结果。