Skip to main content
Deno 2 is finally here 🎉️
Learn more
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.27.0/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]>