Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HmacAlgorithm ¶
type HmacAlgorithm int
HmacAlgorithm type describes the supported hash algorithms for usage in OTP generation.
const ( // HmacSHA1 indicates to use the SHA1 hash to calculate an HMAC. HmacSHA1 HmacAlgorithm = iota + 1 // HmacSHA256 indicates to use the SHA256 hash to calculate an HMAC. HmacSHA256 // HmacSHA512 indicates to use the SHA512 hash to calculate an HMAC. HmacSHA512 )
func (HmacAlgorithm) Hash ¶
func (alg HmacAlgorithm) Hash() (h hash.Hash)
Hash returns a hash.Hash instance corresponding to the HmacAlgorithm type.
func (HmacAlgorithm) MarshalJSON ¶ added in v0.3.0
func (alg HmacAlgorithm) MarshalJSON() ([]byte, error)
MarshalJSON returns a JSON representation of HmacAlgorithm.
func (HmacAlgorithm) String ¶
func (alg HmacAlgorithm) String() string
String returns a string representation of HmacAlgorithm.
Click to show internal directories.
Click to hide internal directories.