From e365ca8da0740c6a9dc610267b0d6c934656e4ff Mon Sep 17 00:00:00 2001 From: Ardis Lu Date: Fri, 24 Feb 2023 20:42:27 -0800 Subject: [PATCH] Add JSDoc comments --- decrypt.js | 6 ++++++ encrypt.js | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/decrypt.js b/decrypt.js index 9b5dd54..0e4e897 100644 --- a/decrypt.js +++ b/decrypt.js @@ -1,3 +1,9 @@ +/** + * Decrypt an encrypted string. + * @param {string} content - The ciphertext to decrypt. + * @param {string} password - The password used to encrypt the string. + * @returns {Promise} A promise that resolves the plaintext. + */ export default async function decrypt(content, password) { const encodedPassword = new TextEncoder().encode(password); diff --git a/encrypt.js b/encrypt.js index e8ccc52..f2c52ea 100644 --- a/encrypt.js +++ b/encrypt.js @@ -1,3 +1,9 @@ +/** + * Encrypt a string. + * @param {string} plaintext - The string to encrypt. + * @param {string} password - The password used to encrypt the string. + * @returns {Promise} A promise that resolves the ciphertext. + */ export default async function encrypt(plaintext, password) { const encoder = new TextEncoder(); const encodedPlaintext = encoder.encode(plaintext); -- 2.47.3