Structure
HOTP
Create a one-time password using hash-based message authentication codes.
struct HOTP
Overview
let key = SymmetricKey(size: .bits128)
let code = HOTP.SHA1(key: key).generate(counter: 0)
print(code) "208503"
See TOTP for time-based one-time passwords.
Topics
Initializers
init(key:digest:digits:)Initialize the HOTP object.
Instance Methods
generate(counter:)Generate the HOTP based on the counter.generate(counter:range:)Generates several HOTP’s for a range.
Type Methods
generate(key:digest:digits:counter:)Compute the HOTP for the key and the counter.
Relationships
Conforms To
Swift.SendableSwift.SendableMetatype