Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/somefn/js/aes.ts>genAesKey

some functions for deno
Go to Latest
function genAesKey
import { genAesKey } from "https://deno.land/x/somefn@v0.24.1/js/aes.ts";

生成 key 功能

功能点:

  1. 随机生成 key.
  2. 支持传入的 base64 编码 key.
  3. 支持传入的二进制 key.

Parameters

type: "AES-CBC" | "AES-GCM"
optional
k:
| string
| Uint8Array
| 128
| 192
| 256
= [UNSUPPORTED]

Returns

Promise<[CryptoKey, Uint8Array]>