Skip to content

Commit

Permalink
Reference SPM support
Browse files Browse the repository at this point in the history
  • Loading branch information
Jitsusama committed May 29, 2017
1 parent 5609245 commit a6c3962
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,24 @@ native unsigned integer types support.

[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)

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

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.

## Usage
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.

## Example
For example:

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

Expand Down

0 comments on commit a6c3962

Please sign in to comment.