appmattus / crypto

A collection of Kotlin Multiplatform cryptographic hashing functions.
Apache License 2.0
90 stars 4 forks source link

Enable JavaScript support #56

Closed mattmook closed 1 week ago

mattmook commented 4 months ago

Since last time JS support was tried there have been improvements to the JS implementation of Int and Long to work "as expected" with regards to overflow. See:

https://kotlinlang.org/docs/js-to-kotlin-interop.html#kotlin-types-in-javascript

Although, re-trying with Kotlin 2.0 is still giving exceptions across various hashing algorithms, so perhaps something doesn't work as expected. Needs to be debugged.

mattmook commented 4 months ago

Potentially looks like an issue with when variables are initialised versus when a classes init function is called

mattmook commented 4 months ago

Related to https://youtrack.jetbrains.com/issue/KT-42790/KJS-problem-with-init-order