openssl_cipher_iv_length

(PHP 5 >= 5.3.3, PHP 7, PHP 8)

openssl_cipher_iv_length获取密码iv长度

说明

openssl_cipher_iv_length(string $cipher_algo): int|false

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

参数

cipher_algo

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

返回值

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

错误/异常

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

范例

示例 #1 openssl_cipher_iv_length() 范例

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

echo
$ivlen;
?>

以上例程的输出类似于:

16
add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top