From: Ardis Lu Date: Sat, 25 Feb 2023 04:42:27 +0000 (-0800) Subject: Add JSDoc comments X-Git-Url: https://git.ardis.lu/?a=commitdiff_plain;h=e365ca8da0740c6a9dc610267b0d6c934656e4ff;p=static-encrypt Add JSDoc comments --- 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);