Skip to main content
Go to Latest
File
import { assertEquals } from 'https://deno.land/std@v0.172.0/testing/asserts.ts'import { nanoid } from 'https://esm.sh/nanoid@4.0.0/async'import { decrypt } from './decrypt.ts'import { encrypt } from './encrypt.ts'
Deno.test('encrypt and decrypt', async () => { const secret = await nanoid(128)
assertEquals('Hello World', await decrypt(await encrypt('Hello World', secret), secret))})