kotlin-multiplatform-bignum v0.1.6-SNAPSHOT Release Notes
-
- ๐ Fixed #86 - Rounding fails when integer part is 9
- ๐ Fixed #88 - BigInteger.bitAt() returns invalid value
- Built with Kotlin 1.4-M3
- Reworked to(U)ByteArray conversion methods
- from and to conversions were not consistent, from(U)ByteArray expected a string of bytes ordered in little or big endian,
while to(U)ByteArray produced
Int
orLong
represented as byte with little endian or big endian order. - Replaced with a consistent to and from byte/ubyte array conversions
fromUByteArray
always expects a big-endian ordered array of unsigned bytesfromByteArray
always expects a big-endian ordered array of bytestoUByteArray
produces unsigned byte array in big-endian ordertoByteArray
produces signed byte array in big-endian order
- There are two helper methods that convert to and from a two's complement ByteArray, this form conforms to Java BigIntegers toByteArray
fromTwosComplementByteArray
expects a two's complement ByteArray with at least one sign bittoTwosComplementByteArray
produces a two's complement ByteArray with at least one sign bit
- from and to conversions were not consistent, from(U)ByteArray expected a string of bytes ordered in little or big endian,
while to(U)ByteArray produced
- โ Added
secureOverwrite
to BigNumber interface, with role of overwriting backing structures with zeroes. It's meant to be used by libraries that require such a functionlity (i.e. crypto). The function also breaks immutability contract of BigNumber implementations, and further operations with that instances have undefined results.