generateIV static method

String generateIV({
  1. int length = 16,
})

生成安全的随机 IV

生成指定长度的安全随机 IV(初始化向量),返回 Base64 编码的字符串

@param length IV 长度,默认 16 字节 @return 安全的随机 IV(Base64 编码) @example

final iv = WSecret.generateIV();
print(iv); // 输出: 随机生成的 16 字节 IV(Base64 编码)

Implementation

static String generateIV({int length = 16}) {
  return WEncrypt.generateIV(length: length);
}