diff options
| author | Harsh Shandilya <me@msfjarvis.dev> | 2022-03-05 19:17:48 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-03-05 13:47:48 +0000 |
| commit | b8756a667c56f67d14b25286f2568f3eb3e8e9f3 (patch) | |
| tree | ce0c18086ac9f21f564f495e7435741c07106ea9 /format-common/src/main/kotlin/dev/msfjarvis/aps/util | |
| parent | 52c349188ba1c9a93ffcc3976aed652aca2ba418 (diff) | |
| download | HardenedPass-b8756a667c56f67d14b25286f2568f3eb3e8e9f3.tar.gz HardenedPass-b8756a667c56f67d14b25286f2568f3eb3e8e9f3.zip | |
Cleanup IDE reported lints in autofill-parser and format-common (#1765)
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 | 6 |
1 files changed, 1 insertions, 5 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 f1f71e00..0a3921db 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 @@ -19,10 +19,6 @@ internal object Otp { private val BASE_32 = Base32() private val STEAM_ALPHABET = "23456789BCDFGHJKMNPQRTVWXY".toCharArray() - init { - check(STEAM_ALPHABET.size == 26) - } - fun calculateCode( secret: String, counter: Long, @@ -51,7 +47,7 @@ internal object Otp { var remainingCodeInt = codeInt buildString { repeat(5) { - append(STEAM_ALPHABET[remainingCodeInt % 26]) + append(STEAM_ALPHABET[remainingCodeInt % STEAM_ALPHABET.size]) remainingCodeInt /= 26 } } |
