OTP

Handles one-time password (OTP) generation.

pacersdk.otp.hotp(key: str, counter: int, digits: int = 6)

Generate a HMAC-based one-time password (HOTP) token.

Parameters:
  • key – Base32 encoded secret.

  • counter – Number of 30s intervals since epoch.

  • digits – Number of digits in the OTP.

Returns:

Generated HOTP token.

pacersdk.otp.totp(key: str, time_step: int = 30, digits: int = 6)

Generate a time-based one-time password (TOTP) token.

Parameters:
  • key – Base32 encoded secret.

  • time_step – Time step in seconds.

  • digits – Number of digits in the OTP.

Returns:

Generated TOTP token.