Skip to content

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

Instance Methods

Type Methods

Relationships

Conforms To

  • Swift.Sendable
  • Swift.SendableMetatype

See Also

One-Time Passwords

  • TOTP
    Create a one-time password using hash-based message authentication codes and taking uniqueness from the time.
  • OTPDigits
    Supported OTP output sizes.
  • OTPDigest
    Supported OTP digests.