replace IllegalArgumentException with require
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user