gmkitx API - v0.10.1
    正在准备搜索索引...

    变量 zucEncrypt常量

    zucEncrypt: (
        key: BytesLike,
        iv: BytesLike,
        plaintext: string | Uint8Array<ArrayBufferLike>,
        options?: ZUCOptions,
    ) => string = zucFunctions.encrypt

    使用 ZUC-128 流密码加密;key 与 IV 必须各为 16 字节。

    类型声明

      • (
            key: BytesLike,
            iv: BytesLike,
            plaintext: string | Uint8Array<ArrayBufferLike>,
            options?: ZUCOptions,
        ): string
      • 使用 ZUC-128 流密码加密数据

        参数

        • key: BytesLike

          128-bit key (16 bytes or 32 hex chars) / 128 位密钥

        • iv: BytesLike

          128-bit IV (16 bytes or 32 hex chars) / 128 位初始向量

        • plaintext: string | Uint8Array<ArrayBufferLike>

          Data to encrypt (string or Uint8Array) / 要加密的数据

        • 可选options: ZUCOptions

          Encryption options / 加密选项

        返回 string

        Encrypted data (default hex string) / 加密后的数据(默认十六进制字符串)

        // 默认 hex 格式(向后兼容)
        const encrypted = encrypt(key, iv, 'data');
        // Base64 格式
        const encrypted = encrypt(key, iv, 'data', { outputFormat: OutputFormat.BASE64 });