Documentation ¶
Index ¶
- Variables
- func GeneratePasscode(secret string, counter uint64) (string, error)
- func GeneratePasscodeWithOption(secret string, counter uint64, opt *Option) (string, error)
- func Validate(passcode string, secret string, counter uint64) (bool, error)
- func ValidateWithOption(passcode string, secret string, counter uint64, opt *Option) (bool, error)
- type Option
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrHOTPOptionIsNil = errors.New("hotp option is nil")
ErrHOTPOptionIsNil is an error when the hotp option is nil
Functions ¶
func GeneratePasscode ¶
GeneratePasscode generates a passcode with using default value of option
func GeneratePasscodeWithOption ¶
GeneratePasscodeWithOption generates a passcode This function can pass custom value of option When this executes, it returns a HMAC-based One Time Password See: https://tools.ietf.org/html/rfc4226#section-5.2
Types ¶
type Option ¶
type Option struct {
// contains filtered or unexported fields
}
Option is used when operates the HMAC-based One Time Password
func (*Option) SetAlgorithm ¶
SetAlgorithm sets the hash algorithm
Click to show internal directories.
Click to hide internal directories.