3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-07-07 02:57:20 +00:00

perf: move encryption/decryption to a separate thread

This commit is contained in:
Dragory 2021-10-09 14:21:23 +03:00
parent 0b337a13a4
commit b7c7e002eb
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1
16 changed files with 310 additions and 147 deletions

View file

@ -1,9 +1,9 @@
import test from "ava";
import { decrypt, encrypt } from "./crypt";
test("encrypt() followed by decrypt()", (t) => {
test("encrypt() followed by decrypt()", async (t) => {
const original = "banana 123 👀 💕"; // Includes emojis to verify utf8 stuff works
const encrypted = encrypt(original);
const decrypted = decrypt(encrypted);
const encrypted = await encrypt(original);
const decrypted = await decrypt(encrypted);
t.is(decrypted, original);
});