Home Reference Source
public class | source

SCRYPT

Extends:

Crypt → SCRYPT

Use scrypt.

Requires scrypt (npm install scrypt).

Constructor Summary

Public Constructor
public

constructor(options: Object)

Member Summary

Public Members
public

params: *

Method Summary

Public Methods
public

async hashImplementation(password: *): *

public

async verifyImplementation(password: *, hash: *): *

Inherited Summary

From class Crypt
public

async hash(password: string): string

Hash a password.

public abstract

async hashImplementation(password_: string): string

Implementation of hash() minus checks.

public

async verify(password: String, hash: String): boolean

Verify a password against previously hashed password

public

async verifyImplementation(password: String, hash: String): boolean

Implementation of verify() minus checks.

Public Constructors

public constructor(options: Object) source

Params:

NameTypeAttributeDescription
options Object
  • optional
  • default: {}
options.maxtime Number
  • optional
  • default: 0.1

see https://www.npmjs.com/package/scrypt#params

Public Members

public params: * source

Public Methods

public async hashImplementation(password: *): * source

Implementation of hash() minus checks.

Override:

Crypt#hashImplementation

Params:

NameTypeAttributeDescription
password *

Return:

*

public async verifyImplementation(password: *, hash: *): * source

Implementation of verify() minus checks.

Default implementation hashes new password and does string compare. This'll work for weaker hashes like md5 but won't work for stronger ones like scrypt.

Override:

Crypt#verifyImplementation

Params:

NameTypeAttributeDescription
password *
hash *

Return:

*