ionspin / kotlin-multiplatform-bignum

A Kotlin multiplatform library for arbitrary precision arithmetics
Apache License 2.0
364 stars 42 forks source link

fixed removal of leading zero bytes in BigInteger::toByteArray #157

Closed fullkomnun closed 3 years ago

fullkomnun commented 3 years ago

Fixed the removal of leading zero bytes in BigInteger::toByteArray (the result of removal was ignored). However, this will result in BigInteger.ZERO.toByteArray == byteArrayOf() while java's BigInteger will return byteArrayOf(0). This still causes some test failures in com.ionspin.kotlin.bignum.integer.ByteArrayConversionTest that have to be looked into.