Generate Recovery-Codes
This generator can be used to create randomly generated strings in block form.
generateRecoveryCode
Info
You can create a recovery-code with the this method. Typically, recovery-codes are used to authenticate when a user loses access to their second factor device.
Usage
recoveryCodeGenerator.generateRecoveryCode()
This will generate a recovery code similar to the following code:
> "AAAA-BBBB-CCCC-DDDD"
generateRecoveryCodes
Info
Usually a user receives multiple recovery-codes. You can use the following helper method to generate a list of recovery-codes instead of calling the single method multiple times.
Usage
recoveryCodeGenerator.generateRecoveryCodes(number = 3)
The generated list looks like this:
> ["AAAA-BBBB-CCCC-DDDD", "BBBB-AAAA-CCCC-DDDD", "BBBB-AAAA-DDDD-CCCC"]
Arguments
Argument | Type | Default | Constraint |
---|---|---|---|
number | Int | 5 | >= 0 |