Compare commits

...

2 Commits

Author SHA1 Message Date
8870703608 replace IllegalArgumentException with require 2025-12-14 00:16:09 +01:00
25e6fcdeab update README
bump version
2025-12-13 23:29:47 +01:00
2 changed files with 2 additions and 3 deletions

View File

@@ -25,7 +25,7 @@ repositories {
} }
dependencies { dependencies {
implementation("com.infendro:otp:1.2.1") implementation("com.infendro:otp:1.2.2")
} }
``` ```

View File

@@ -25,8 +25,7 @@ class HOTP(
secret: UByteArray, secret: UByteArray,
counter: Long, counter: Long,
): String { ): String {
if (counter < 0) require(counter >= 0)
throw IllegalArgumentException()
val hash = generateHash(secret, counter.toUByteArray()) val hash = generateHash(secret, counter.toUByteArray())
return otp(hash) return otp(hash)