Add documentation to Argon2idOptions

This commit is contained in:
Simon Warta 2020-07-22 11:23:20 +02:00
parent 4a8bbf014f
commit 8798e7046f
2 changed files with 26 additions and 4 deletions

View File

@ -6,12 +6,21 @@
import sodium from "libsodium-wrappers";
export interface Argon2idOptions {
// in bytes
/** Output length in bytes */
readonly outputLength: number;
// integer between 1 and 4294967295
/**
* An integer between 1 and 4294967295 representing the computational difficulty.
*
* @see https://libsodium.gitbook.io/doc/password_hashing/default_phf#key-derivation
*/
readonly opsLimit: number;
// memory limit measured in KiB (like argon2 command line tool)
// Note: only ~ 16 MiB of memory are available using the non-sumo version of libsodium
/**
* Memory limit measured in KiB (like argon2 command line tool)
*
* Note: only approximately 16 MiB of memory are available using the non-sumo version of libsodium.js
*
* @see https://libsodium.gitbook.io/doc/password_hashing/default_phf#key-derivation
*/
readonly memLimitKib: number;
}

View File

@ -1,6 +1,19 @@
export interface Argon2idOptions {
/** Output length in bytes */
readonly outputLength: number;
/**
* An integer between 1 and 4294967295 representing the computational difficulty.
*
* @see https://libsodium.gitbook.io/doc/password_hashing/default_phf#key-derivation
*/
readonly opsLimit: number;
/**
* Memory limit measured in KiB (like argon2 command line tool)
*
* Note: only approximately 16 MiB of memory are available using the non-sumo version of libsodium.js
*
* @see https://libsodium.gitbook.io/doc/password_hashing/default_phf#key-derivation
*/
readonly memLimitKib: number;
}
export declare class Argon2id {