codecamp

PHP8 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


PHP8 OpenSSL证书验证
PHP8 openssl_cipher_key_length
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定