Skip to content
This repository has been archived by the owner on Dec 13, 2023. It is now read-only.

Commit

Permalink
feat: Browser support (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
dinkar-jain authored Sep 21, 2023
2 parents c6b093d + d9e7925 commit 453070b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import org.jetbrains.kotlin.utils.addToStdlib.cast
import org.jetbrains.kotlin.utils.addToStdlib.castAll

plugins {
kotlin("multiplatform") version "1.8.21"
kotlin("multiplatform") version "1.9.10"
id("dev.petuska.npm.publish") version "3.3.1"
`maven-publish`
}
Expand Down Expand Up @@ -50,6 +50,7 @@ kotlin {
sourceSets {
val commonMain by getting {
dependencies {
implementation("dev.whyoleg.cryptography:cryptography-random:0.2.0")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.4.1")
implementation("com.soywiz.korlibs.krypto:krypto:$kryptoVersion")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.1")
Expand Down
3 changes: 2 additions & 1 deletion src/commonMain/kotlin/id/walt/sdjwt/SDPayload.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package id.walt.sdjwt

import dev.whyoleg.cryptography.random.CryptographyRandom
import korlibs.crypto.SecureRandom
import korlibs.crypto.encoding.Base64
import korlibs.crypto.sha256
Expand Down Expand Up @@ -120,7 +121,7 @@ data class SDPayload internal constructor (
}

private fun generateSalt(): String {
val randomness = SecureRandom.nextBytes(16)
val randomness = CryptographyRandom.nextBytes(16)
return Base64.encode(randomness, url = true)
}

Expand Down

0 comments on commit 453070b

Please sign in to comment.