recoverycode

package
v0.11.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 4, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const Alphabet = "ABCDEFHJKLMNPQRSTUVWXYZ2345789"

Alphabet contains all upper-case characters except for numbers/letters that look alike.

View Source
const AlphabetLegacy = "ABCDEFHJKMNPQRSTUVWXYZ2345789"

AlphabetLegacy constains the letters that pre version 2 recovery codes can contain.

View Source
const CurrentVersion = 2

CurrentVersion defines the current version number for the recovery codes.

Variables

This section is empty.

Functions

func ConvertToKey

func ConvertToKey(code, salt string) (*btcec.PrivateKey, error)

ConvertToKey generates a private key using the recovery code as a seed.

The salt parameter is only used for version 1 codes. It will be ignored for version 2+ codes.

func Generate

func Generate() string

Generate creates a new random recovery code using a cryptographically secure random number generator.

func Validate

func Validate(code string) error

Validate returns an error if the recovery code is not valid or nil otherwise.

func Version

func Version(code string) (int, error)

Version returns the version that this recovery code corresponds to.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL