Infendro f5f073168d
All checks were successful
/ test (pull_request) Successful in 33s
minor refactor
2026-01-30 13:23:32 +01:00
2026-01-29 18:15:06 +01:00
2026-01-29 18:12:16 +01:00
2025-07-12 20:04:39 +02:00
2026-01-29 18:12:16 +01:00
2025-08-17 14:52:48 +02:00
2025-08-17 14:52:48 +02:00
2025-07-12 20:04:39 +02:00
2026-01-29 18:12:16 +01:00

otp-kt

otp-kt is a Kotlin Multiplatform library that provides common One-Time Password algorithms.

Supported algorithms:

  • HOTP
  • TOTP

Installation

Add the following to your build.gradle.kts.

repositories {
    maven("https://git.infendro.com/api/packages/Infendro/maven")
}

dependencies {
    implementation("com.infendro:otp:1.3.0")
}

Usage

fun main() {
    // create TOTP instance
    val totp = TOTP(
        function = SHA1,
        length = 6,
        period = 30.seconds,
    )

    // generate and verify OTP
    val now = System.now()
    val otp = totp.generate(<secret>, now)
    totp.verify(<secret>, now, otp)
}
Description
No description provided
Readme 168 KiB
Languages
Kotlin 100%