We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BigInteger.fromByteArray
Describe the bug BigInteger.fromByteArray fails in JS but works with no issues in all other platforms.
To Reproduce Steps to reproduce the behaviour:
val byteArrayInBase64Padded = "P6XiWtDoaj6g3le12ljqjl3J/ZXa/kRswC9GNUYmkTU=" val byteArray = byteArrayInBase64Padded.base64PadDecodedBytes // value is [63, -91, -30, 90, -48, -24, 106, 62, -96, -34, 87, -75, -38, 88, -22, -114, 93, -55, -3, -107, -38, -2, 68, 108, -64, 47, 70, 53, 70, 38, -111, 53] // correct value val bigInteger = BigInteger.fromByteArray(byteArray, Sign.POSITIVE) // fails here with `ClassCastException` println(bigInteger.toString()) // 28788801469504357252816216561604952156895770089726804292579259475621317087541
Expected behaviour Should create a BigInteger value without issue.
Platform [JS]
If JS (please complete the following information):
Additional context The following method in unit test testToAndFromByteArray on https://github.com/ionspin/kotlin-multiplatform-bignum/blob/main/bignum/src/commonTest/kotlin/com/ionspin/kotlin/bignum/integer/ByteArrayConversionTest.kt also fails with the same exception ClassCastException.
testToAndFromByteArray
ClassCastException
The text was updated successfully, but these errors were encountered:
Thanks for reporting.
Sorry, something went wrong.
Sorry for taking so long to look into this, is it still reproducible?
Unfortunately yes, it is still reproducible
ionspin
No branches or pull requests
Describe the bug
BigInteger.fromByteArray
fails in JS but works with no issues in all other platforms.To Reproduce
Steps to reproduce the behaviour:
Expected behaviour
Should create a BigInteger value without issue.
Platform
[JS]
If JS (please complete the following information):
Additional context
The following method in unit test
testToAndFromByteArray
on https://github.com/ionspin/kotlin-multiplatform-bignum/blob/main/bignum/src/commonTest/kotlin/com/ionspin/kotlin/bignum/integer/ByteArrayConversionTest.kt also fails with the same exceptionClassCastException
.The text was updated successfully, but these errors were encountered: