Methods
oplop(labelParam, masterParam, lengthParamopt) → {string}
Create a password given a label/mnemonic and master password and optional length.
NOTE Unless length is explicitly passed as the third parameter, this library uses the "loplop" variation where the label can use an optional DSL:
- if the label begins with a
<digit>*
, theshould be the length of the password, - if the label begins with a
*
, the length of the password is assumed the classic length of 8, - otherwise the password will be 16 characters long.
- Source:
- See:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
labelParam |
string
|
label/mnemonic |
|
masterParam |
string
|
master password |
|
lengthParam |
string
|
<optional> |
optional length of generated password |
Returns:
- Type:
-
string
the generated password
Example
// 16-character password using `label` and `master`
let password = require('loplop') ('label', 'master');
// 8-character password using `label` and `master`
let password = require('loplop') ('*label', 'master');
let password = require('loplop') ('label', 'master', 8);
// 10-character password using `label` and `master`
let password = require('loplop') ('10*label', 'master')
let password = require('loplop') ('label', 'master', 10)