mcrypt_module_self_test()
(PHP 4 >= 4.0.2, PHP 5, PHP 7 < 7.2.0, PECL mcrypt >= 1.0.0)
在指定模块上执行自检
WarningThis function has beenDEPRECATEDas of PHP 7.1.0. Relying on this functionis highly discouraged.
说明
mcrypt_module_self_test(string $algorithm[,string $lib_dir]): bool
在指定模块上执行自检。
参数
- $algorithm
MCRYPT_ciphername
常量中的一个,或者是字符串值的算法名称。- $lib_dir
可选参数$lib_dir,表示包含加密算法模块的路径。
返回值
自检成功返回TRUE
,自检失败返回FALSE
。
范例
mcrypt_module_self_test()例程
<?php var_dump(mcrypt_module_self_test(MCRYPT_RIJNDAEL_128)) . "\n"; var_dump(mcrypt_module_self_test(MCRYPT_BOGUS_CYPHER)); ?>
以上例程会输出:
bool(true) bool(false)