SeaSalt_Tools


SeaSalt_Tools

A collection of commonly used tools

Constructor

new SeaSalt_Tools(configopt)

Parameters
config:Object (optional)

User-provided configuration data

Properties
config:Object

Configuration data

config.minimumEntropy:number = 6 (optional)

Minimum password entropy required

config.minimumKeyLength:number = 6 (optional)

Minimum password character length

config.minimumStrength:number = 1 (optional)

Minimum password strength

config.logger:function = config.log (optional)

Logging handler

Methods

passwordStrength(password):number

Calculate the strength of a supplied password

Parameters
password:string

Password to check

Returns
Type
:number

Returns the calculated strength of the provided password.

randomString(lengthopt, alphaopt, capsopt, numericopt, symbolsopt):string

Generates a random string of any length with a variable character pool.

Parameters
length:number = 32 (optional)

Length of string to generate

alpha:boolean = true (optional)

Include lower case alphabet in the pool

caps:boolean = true (optional)

Include upper case alphabet in the pool

numeric:boolean = true (optional)

Include numbers in the pool

symbols:boolean = true (optional)

Include symbols in the pool

Returns
Type
:string

Returns a random string from the character pool.