Skip to content

3.0.0

Compare
Choose a tag to compare
@lorentey lorentey released this 07 Sep 12:18
· 82 commits to master since this release

This is a major release upgrading BigInt to the new integer protocols introduced in Swift 4 as part of SE-0104, Protocol-oriented integers.

  • Adopting the new protocols involved major, breaking changes throughout the API. These aren't individually listed here.
  • The BigUInt struct now provides inline storage for big integers that fit inside two words. This optimization speeds up conversions from built-in fixed-width integer types, amongst other frequent operations.
  • BigInt and BigUInt implements the new Codable protocol. In both cases, values are encoded in an unkeyed container starting with a string indicating the sign ("+" or "-"), followed by a sequence of 64-bit unsigned integers representing component words, from least to most significant.
  • New method: BigInt.modulo, contributed by @FabioTacke.
  • BigUInt does not implement Collection in this release. The collection of words is available in the standard read-only words property. Direct public access to collection methods have been removed; if you have been manipulating big integers using collection methods, you need to rewrite your code. If you have a usecase that isn't covered by the public API, please submit a PR adding the missing functionality. (Public read-write access to the underlying storage inside BigUInt will not be restored, though.)

BigInt is now part of the Attaswift project. The bundle identifiers in the supplied Xcode project have been updated accordingly.

Note that the URL for the package's Git repository has changed; please update your references.