OathCodeInfo

@Serializable
data class OathCodeInfo(val code: String, val timeRemaining: Int, val counter: Long, val progress: Double, val totalPeriod: Int)

Class that contains OTP code information, including the actual code and validity details.

Constructors

Link copied to clipboard
constructor(code: String, timeRemaining: Int, counter: Long, progress: Double, totalPeriod: Int)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

The generated OTP code.

Link copied to clipboard

For HOTP, the current counter value after code generation. For TOTP, this will be -1.

Link copied to clipboard

For TOTP, a value from 0.0 to 1.0 indicating progress through the time window. For HOTP, this will be 0.0.

Link copied to clipboard

For TOTP, the time remaining in seconds before the code expires. For HOTP, this will be -1.

Link copied to clipboard

For TOTP, the total validity period in seconds. For HOTP, this will be 0.

Functions

Link copied to clipboard
fun toJson(): String

Converts this code info to a JSON string representation.