aboutsummaryrefslogtreecommitdiff
path: root/format-common/src
diff options
context:
space:
mode:
authorHarsh Shandilya <me@msfjarvis.dev>2022-03-05 19:17:48 +0530
committerGitHub <noreply@github.com>2022-03-05 13:47:48 +0000
commitb8756a667c56f67d14b25286f2568f3eb3e8e9f3 (patch)
treece0c18086ac9f21f564f495e7435741c07106ea9 /format-common/src
parent52c349188ba1c9a93ffcc3976aed652aca2ba418 (diff)
Cleanup IDE reported lints in autofill-parser and format-common (#1765)
Diffstat (limited to 'format-common/src')
-rw-r--r--format-common/src/main/kotlin/dev/msfjarvis/aps/data/passfile/PasswordEntry.kt2
-rw-r--r--format-common/src/main/kotlin/dev/msfjarvis/aps/util/totp/Otp.kt6
2 files changed, 1 insertions, 7 deletions
diff --git a/format-common/src/main/kotlin/dev/msfjarvis/aps/data/passfile/PasswordEntry.kt b/format-common/src/main/kotlin/dev/msfjarvis/aps/data/passfile/PasswordEntry.kt
index c36cb0ed..94149477 100644
--- a/format-common/src/main/kotlin/dev/msfjarvis/aps/data/passfile/PasswordEntry.kt
+++ b/format-common/src/main/kotlin/dev/msfjarvis/aps/data/passfile/PasswordEntry.kt
@@ -13,14 +13,12 @@ import dev.msfjarvis.aps.util.time.UserClock
import dev.msfjarvis.aps.util.totp.Otp
import dev.msfjarvis.aps.util.totp.TotpFinder
import kotlin.collections.set
-import kotlin.time.ExperimentalTime
import kotlinx.coroutines.awaitCancellation
import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.flow
/** Represents a single entry in the password store. */
-@OptIn(ExperimentalTime::class)
public class PasswordEntry
@AssistedInject
constructor(
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
}
}