Documentation ¶
Overview ¶
Package twofactor contains support functions and types for two-factor authentication.
This package provides shared structs and functions for all implementations.
To generate a new secret for 2FA, use the NewSecret method:
import "gopkg.in/zhevron/go-twofactor.v1" secret := twofactor.NewSecret(0)
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Int64ToBytes ¶
Int64ToBytes converts a 64-bit integer to a 8-byte slice.
Types ¶
type Secret ¶
type Secret string
Secret wraps a string with functions to generate a cryptographically secure secret.
func NewSecret ¶
NewSecret generates a cryptograpically secure string of the given length. If the length provided is 0 or less, it will default to a length of 10.
Click to show internal directories.
Click to hide internal directories.