Skip to content

Commit

Permalink
jetbrains please add base32 decoding to kotlin stdlib already
Browse files Browse the repository at this point in the history
  • Loading branch information
X1nto committed Oct 29, 2023
1 parent 67a7a3a commit 77e7316
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ package com.xinto.mauth.core.otp.transformer

import org.apache.commons.codec.binary.Base32

class DefaultKeyTransformer(
private val base32: Base32
) : KeyTransformer {
class DefaultKeyTransformer : KeyTransformer {

private val base32 = Base32()

override fun transformToBytes(key: String): ByteArray {
val trimmed = key.trim()
Expand Down
5 changes: 1 addition & 4 deletions app/src/main/java/com/xinto/mauth/di/MauthDI.kt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import com.xinto.mauth.ui.screen.pinremove.PinRemoveViewModel
import com.xinto.mauth.ui.screen.pinsetup.PinSetupViewModel
import com.xinto.mauth.ui.screen.qrscan.QrScanViewModel
import com.xinto.mauth.ui.screen.settings.SettingsViewModel
import org.apache.commons.codec.binary.Base32
import org.koin.android.ext.koin.androidContext
import org.koin.androidx.viewmodel.dsl.viewModelOf
import org.koin.core.module.dsl.singleOf
Expand All @@ -36,9 +35,7 @@ object MauthDI {
val CoreModule = module {
singleOf(::DefaultOtpGenerator) bind OtpGenerator::class
singleOf(::DefaultOtpUriParser) bind OtpUriParser::class
single {
DefaultKeyTransformer(Base32())
} bind KeyTransformer::class
singleOf(::DefaultKeyTransformer) bind KeyTransformer::class
singleOf(::DefaultSettings) bind Settings::class
singleOf(::DefaultAuthManager) bind AuthManager::class
}
Expand Down

0 comments on commit 77e7316

Please sign in to comment.