whyoleg/cryptography-kotlin

CryptographyRandom::nextInt is failed on wasmJs target

Closed this issue · 1 comments

Simple reproducer is failed on wasmJs (both nodejs and browser) target (works fine on all other targets):

@Test
fun test() {
    val k = CryptographyRandom.nextInt(10)
}

Exception:

IrLinkageError: Can not read value from variable 'jsArray': Variable uses unlinked class symbol 'org.khronos.webgl/Int8Array|null[0]'

kotlin 2.1.0

I'm not sure if it's compiler or library issue.

Hey!
That's because those declaration are now coming from kotlinx-browser for wasmJs (changelog for Kotlin 2.1.0).
You can try to add this dependency in your project.
I will fix it in an upcoming patch release