array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'zh', ), 'this' => array ( 0 => 'function.mcrypt-module-self-test.php', 1 => 'mcrypt_module_self_test', ), 'up' => array ( 0 => 'ref.mcrypt.php', 1 => 'Mcrypt 函数', ), 'prev' => array ( 0 => 'function.mcrypt-module-open.php', 1 => 'mcrypt_module_open', ), 'next' => array ( 0 => 'function.mdecrypt-generic.php', 1 => 'mdecrypt_generic', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'zh', 'path' => 'reference/mcrypt/functions/mcrypt-module-self-test.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 4 >= 4.0.2, PHP 5, PHP 7 < 7.2.0, PECL mcrypt >= 1.0.0)
mcrypt_module_self_test — 在指定模块上执行自检
本函数已自 PHP 7.1.0 起废弃并将自 PHP 7.2.0 起移除。强烈建议不要使用本函数。
algorithm
MCRYPT_ciphername
常量中的一个,或者是字符串值的算法名称。
lib_dir
可选参数 lib_dir
,
表示包含加密算法模块的路径。
示例 #1 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)