Skip to content

Commit b304964

Browse files
authored
Merge pull request #527 from supabase-community/fix-digest
Fix iOS Native Apple Sign in Digest error
2 parents 5f9ee8f + 3617c6d commit b304964

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

plugins/ComposeAuth/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ kotlin {
5252
dependencies {
5353
api(project(":gotrue-kt"))
5454
implementation(compose.runtime)
55+
implementation(libs.krypto)
5556
}
5657
}
5758
val noDefaultMain by creating {
Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
package io.github.jan.supabase.compose.auth
22

3-
import io.ktor.util.Digest
43
import io.ktor.utils.io.core.toByteArray
4+
import korlibs.crypto.SHA256
55

6-
@OptIn(ExperimentalStdlibApi::class)
7-
internal suspend fun String.hash(): String {
8-
val digest = Digest("SHA-256")
9-
digest += this.toByteArray()
10-
return digest.build().toHexString()
6+
internal fun String.hash(): String {
7+
val hash = SHA256.digest(this.toByteArray())
8+
return hash.hex
119
}

0 commit comments

Comments
 (0)