openssl_cipher_iv_length

(PHP 5 >= 5.3.3, PHP 7)

openssl_cipher_iv_length获取密码iv长度

说明

openssl_cipher_iv_length ( string $method ) : int

获取密码初始化向量(iv)长度。

参数

method

密码的方法,更多值查看 openssl_get_cipher_methods() 函数。

返回值

成功,返回密码长度, 失败返回 FALSE .

错误/异常

当密码方法未知时,抛出一个E_WARNING 级的错误。

范例

Example #1 openssl_cipher_iv_length() 范例

<?php
$method 
'AES-128-CBC';
$ivlen openssl_cipher_iv_length($method);

echo 
$ivlen;
?>

以上例程的输出类似于:

16