From 8870703608d4dcd6d4c03da339c0c01a2b87d1e5 Mon Sep 17 00:00:00 2001 From: Infendro Date: Sun, 14 Dec 2025 00:16:09 +0100 Subject: [PATCH] replace IllegalArgumentException with require --- src/commonMain/kotlin/com/infendro/otp/HOTP.kt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/commonMain/kotlin/com/infendro/otp/HOTP.kt b/src/commonMain/kotlin/com/infendro/otp/HOTP.kt index cc41940..f8df4b2 100644 --- a/src/commonMain/kotlin/com/infendro/otp/HOTP.kt +++ b/src/commonMain/kotlin/com/infendro/otp/HOTP.kt @@ -25,8 +25,7 @@ class HOTP( secret: UByteArray, counter: Long, ): String { - if (counter < 0) - throw IllegalArgumentException() + require(counter >= 0) val hash = generateHash(secret, counter.toUByteArray()) return otp(hash)