Constructor
new SeaSalt_PWHash_SCrypt()
Source: seasalt.js, line 391
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 SCrypt hash of the supplied password.
Example
let scrypt = new SeaSalt_PWHash_SCrypt();
scrypt.create('myterriblepassword');
// returns the scrypt string like: $7$C6....1....HnSL7MLPJo3Q3aJLYzzfP96kaFajuaoBuohB1HDKJ97$01YB7VEvx4jw2GLUATR46n4M6Ng7CmK2eLVLs4j8ZSC
Source: seasalt.js, line 404
verify(hash, password):boolean
Verify if a password matches an SCrypt hash.
Parameters
hash:string
password:string
SCrypt hash
User password
Returns
- Type
- :boolean
Example
// using the example from scrypt.create
let scrypt = new SeaSalt_PWHash_SCrypt();
scrypt.verify('$7$C6....1....HnSL7MLPJo3Q3aJLYzzfP96kaFajuaoBuohB1HDKJ97$01YB7VEvx4jw2GLUATR46n4M6Ng7CmK2eLVLs4j8ZSC', 'myterriblepassword');
Source: seasalt.js, line 441