Constructor
new SeaSalt_PWHash_Argon2()
Source: seasalt.js, line 329
Methods
create(password, securityopt):string
Parameters
password:string
security:string
= normal
(optional)
Password to hash
Security level to hash with
Returns
- Type
- :string
Returns the Argon2 hash of the supplied password.
Example
let argon2 = new SeaSalt_PWHash_Argon2();
argon2.create('myterriblepassword');
// returns the argon2 string like: $argon2id$v=19$m=65536,t=4,p=1$Vp+2jMiZyshaDgdVWDBRiQ$zOQo/pYHko7cZpKo9ptgBKGd4oJgCzOoRJa7FiPDRqA
Source: seasalt.js, line 342
verify(hash, password):boolean
Verify if a password matches an Argon2 hash.
Parameters
hash:string
password:string
Argon2 hash
User password
Returns
- Type
- :boolean
Example
// using the example from argon2.create
let argon2 = new SeaSalt_PWHash_Argon2();
argon2.verify('$argon2id$v=19$m=65536,t=4,p=1$Vp+2jMiZyshaDgdVWDBRiQ$zOQo/pYHko7cZpKo9ptgBKGd4oJgCzOoRJa7FiPDRqA', 'myterriblepassword');
Source: seasalt.js, line 377