Latest 0.8.0
License Apache-2.0
Platforms ios 8.0, tvos 9.0, osx 10.9, watchos 2.0

A Swift 128-bit Unsigned Integer Data Type conforming to the UnsignedInteger Protocol.
This library also implements a number of other initializers and properties that Swift’s
native unsigned integer types support.

Carthage compatible


This library includes Carthage, CocoaPods and SPM support out of the box.
Reference this git repository in a Podfile, Cartfile or Package.swift file in
order to easily include this library while also being able to easily track

You can also manually copy over the Sources/UInt128.swift file into your project
and it should work great. I’ve purposely kept this library constrained to a
single file in order to support this use case.


Since this library fully implements the UnsignedInteger protocol, you can use
this data type just like any other native UInt data type. For numbers larger
than UIntMax, you’ll either want to call the init(upperBits: UInt64, lowerBits: UInt64) initializer, or, use the init(stringLiteral: String) initializer to
create an instance with a string. The string can be in binary, octal, decimal
or hexadecimal.

For example:

let uInt128ByString: UInt128 = "0xffaabbcc00129823fa9a12d4aa87f498"
let uInt128ByInteger: UInt128 = 1234


This project includes an example Xcode project for building the framework that
also includes a playground that can be utilized for testing things out. This
Xcode project can build from one target a iphone, iphonesimulator or macos
build. It also includes unit testing and code coverage.

Latest podspec

    "name": "UInt128",
    "version": "0.8.0",
    "summary": "A Swift 128-bit Unsigned Integer Data Type",
    "description": "This library provides a Swift 4.0 compatible 128-bit Unsigned Integerndata type. It includes support for all of the protocols that you wouldnexpect from a native UnsignedInteger type in the Swift standard library.",
    "homepage": "",
    "license": {
        "type": "Apache-2.0",
        "file": "LICENSE"
    "authors": {
        "Joel Gerber": "[email protected]"
    "source": {
        "git": "",
        "tag": "0.8.0"
    "source_files": "Sources/*",
    "swift_version": "4.0",
    "platforms": {
        "ios": "8.0",
        "tvos": "9.0",
        "osx": "10.9",
        "watchos": "2.0"

Pin It on Pinterest

Share This