You should explain that the block size is return in BYTES, not the more commonly used unit, bits. Many readers are not going to know the DES block size and figure this out on their own.
(PHP 4, PHP 5, PHP 7 < 7.2.0, PECL mcrypt >= 1.0.0)
mcrypt_get_block_size — 获得加密算法的分组大小
This function has been DEPRECATED as of PHP 7.1.0. Relying on this function is highly discouraged.
$cipher
) : int$cipher
, string $mode
) : int第一个原型针对 libmcrypt 2.2.x, 第二个原型针对 libmcrypt 2.4.x 或 2.5.x。
mcrypt_get_block_size() 用来获取
cipher
(其中包括了加密模式)
加密算法分组大小。
mcrypt_enc_get_block_size() 函数更加有用, 因为它可以使用 mcrypt_module_open() 函数所返回的资源。
cipher
MCRYPT_ciphername
常量中的一个,或者是字符串值的算法名称。
mode
MCRYPT_MODE_modename
常量中的一个,或以下字符串中的一个:"ecb","cbc","cfb","ofb","nofb" 和 "stream"。
返回以字节为单位的此算法的分组数据大小。 或者在失败时返回 FALSE
。
Example #1 mcrypt_get_block_size() 例程
在 libmcrypt 2.4.x 和 2.5.x 下 如何使用本函数。
<?php
echo mcrypt_get_block_size('tripledes', 'ecb'); // 8
?>
You should explain that the block size is return in BYTES, not the more commonly used unit, bits. Many readers are not going to know the DES block size and figure this out on their own.