函数名称:mcrypt_get_block_size()
适用版本:PHP 4 >= 4.0.2, PHP 5, PHP 7
函数描述:mcrypt_get_block_size() 函数用于获取指定加密算法的块大小。
用法: int mcrypt_get_block_size ( string $cipher [, string $mode ] )
参数:
返回值: 返回指定加密算法的块大小,以字节为单位。如果获取失败,则返回 FALSE。
示例:
$cipher = "des";
$blockSize = mcrypt_get_block_size($cipher);
echo "The block size for {$cipher} is {$blockSize} bytes";
输出: The block size for des is 8 bytes
注意:在 PHP 7.1.0 版本中,mcrypt 扩展已被废弃,因此建议使用 OpenSSL 扩展或其他加密库来替代。