function encrypt
encrypt(plaintext: string): Promise<string>

Encrypt a string value using AES-256-GCM via Web Crypto API Returns format: enc:1:$base64iv:$base64ciphertext Note: ciphertext includes auth tag appended (Web Crypto API does this automatically)

Parameters

plaintext: string

Return Type

Promise<string>

Usage

import { encrypt } from "doc.ts";