-
-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use okio for hashing and another library for secure random
- Loading branch information
1 parent
c2c25c6
commit f13e1e0
Showing
5 changed files
with
15 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 3 additions & 4 deletions
7
...ins/ComposeAuth/src/commonMain/kotlin/io/github/jan/supabase/compose/auth/Utils.common.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
package io.github.jan.supabase.compose.auth | ||
|
||
import io.ktor.utils.io.core.toByteArray | ||
import korlibs.crypto.SHA256 | ||
import okio.ByteString.Companion.toByteString | ||
|
||
internal fun String.hash(): String { | ||
val hash = SHA256.digest(this.toByteArray()) | ||
return hash.hex | ||
val hash = this.encodeToByteArray().toByteString() | ||
return hash.sha256().hex() | ||
} |