首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

mcrypt_list_algorithms

(PHP 4 >= 4.0.2, PHP 5, PHP 7)

mcrypt_list_algorithms - 获取所有支持的密码的数组

警告

这个函数从 PHP 7.1.0 开始已经被 DEPRECATED 了。依靠这个功能是非常不鼓励的。

描述

代码语言:javascript
复制
array mcrypt_list_algorithms ([ string $lib_dir = ini_get("mcrypt.algorithms_dir") ] )

获取lib_dir参数中所有支持的算法的列表。

参数

lib_dir

指定所有算法所在的目录。如果未指定,则使用 mcrypt.algorithms_dir php.ini 指令的值。

返回值

返回一个包含所有支持的算法的数组。

例子

示例#1 mcrypt_list_algorithms()示例

代码语言:javascript
复制
<?php
$algorithms = mcrypt_list_algorithms();
print_r($algorithms);
?>

上面的例子会输出类似于:

代码语言:javascript
复制
Array
(
    [0] => cast-128
    [1] => gost
    [2] => rijndael-128
    [3] => twofish
    [4] => arcfour
    [5] => cast-256
    [6] => loki97
    [7] => rijndael-192
    [8] => saferplus
    [9] => wake
    [10] => blowfish-compat
    [11] => des
    [12] => rijndael-256
    [13] => serpent
    [14] => xtea
    [15] => blowfish
    [16] => enigma
    [17] => rc2
    [18] => tripledes
)

← mcrypt_get_key_size

mcrypt_list_modes →

扫码关注腾讯云开发者

领取腾讯云代金券