Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Generate ¶
func Generate(opts GenerateOptions) (string, error)
Generate generates a Time or Counter based OTP code.
Types ¶
type GenerateOptions ¶
type GenerateOptions struct { Secret string Counter int64 Digits int Algorithm HashAlgorithm }
type HashAlgorithm ¶
type HashAlgorithm string
const ( SHA1 HashAlgorithm = "SHA1" SHA256 HashAlgorithm = "SHA256" SHA512 HashAlgorithm = "SHA512" )
func ToHashAlgorithm ¶
func ToHashAlgorithm(s string) HashAlgorithm
ToHashAlgorithm converts a string into a HashAlgorithm. If the string is empty returns SHA1.
Click to show internal directories.
Click to hide internal directories.