-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
37 lines (37 loc) · 1001 Bytes
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
declare module "@spaceaardvark/encrypt" {
/**
* Encrypt a string with a password.
*
* @param {string} password - plain text password
* @param {string} text - text to encrypt
* @returns {string}
*/
export function encrypt(
password: string,
text: string,
): string;
/**
* Encrypt a string with a password and a custom number of KDF iterations.
*
* @param {string} password - plain text password
* @param {number} iterations - iterations used to generate key
* @param {string} text - text to encrypt
* @returns {string}
*/
export function encryptIterations(
password: string,
iterations: number,
text: string,
): string;
/**
* Decrypt a string encrypted with encrypt().
*
* @param {string} password - password used to generate encryption key
* @param {string} encrypted- string produced by encrypt()
* @returns {string}
*/
export function decrypt(
password: string,
encrypted: string,
): string;
}