diff options
Diffstat (limited to 'format-common/src/main/kotlin/dev/msfjarvis/aps/util')
| -rw-r--r-- | format-common/src/main/kotlin/dev/msfjarvis/aps/util/totp/Otp.kt | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/format-common/src/main/kotlin/dev/msfjarvis/aps/util/totp/Otp.kt b/format-common/src/main/kotlin/dev/msfjarvis/aps/util/totp/Otp.kt index 832529e9..65284441 100644 --- a/format-common/src/main/kotlin/dev/msfjarvis/aps/util/totp/Otp.kt +++ b/format-common/src/main/kotlin/dev/msfjarvis/aps/util/totp/Otp.kt @@ -23,7 +23,8 @@ internal object Otp { check(STEAM_ALPHABET.size == 26) } - fun calculateCode(secret: String, counter: Long, algorithm: String, digits: String) = runCatching { + fun calculateCode(secret: String, counter: Long, algorithm: String, digits: String) = + runCatching { val algo = "Hmac${algorithm.uppercase(Locale.ROOT)}" val decodedSecret = BASE_32.decode(secret) val secretKey = SecretKeySpec(decodedSecret, algo) |
