All Projects → hyugit → UInt256

hyugit / UInt256

Licence: MIT license
An UInt256 library written in Swift 4

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to UInt256

intx
intx – extended precision integer library
Stars: ✭ 83 (+315%)
Mutual labels:  biginteger, uint256
as-bignum
Fixed length big numbers for AssemblyScript 🚀
Stars: ✭ 49 (+145%)
Mutual labels:  biginteger, bigint
swift-numberkit
Advanced numeric data types for Swift 5, including BigInt, Rational, and Complex numbers.
Stars: ✭ 47 (+135%)
Mutual labels:  biginteger, bigint
VisualDebugger
The most elegant and easiest way to visual you data in playground
Stars: ✭ 22 (+10%)
Mutual labels:  playground, swift-package-manager
Base62
PHP Base62 encoder and decoder for integers and big integers with Laravel 5 support.
Stars: ✭ 16 (-20%)
Mutual labels:  biginteger, bigint
BigInteger
Be limited not by the size of your register but by the bulk of your RAM.
Stars: ✭ 13 (-35%)
Mutual labels:  biginteger, bigint
bigint
bigint is a C++ library which can handle Very very Big Integers. It can calculate factorial of 1000000... it can go any big. It may be useful in Competitive Coding and Scientific Calculations which deals with very very large Integers. It can also be used in Decryption process. It has many inbuilt functions which can be very useful.
Stars: ✭ 34 (+70%)
Mutual labels:  biginteger, bigint
BigNumber
A really long long long long long long number in C++
Stars: ✭ 37 (+85%)
Mutual labels:  biginteger, bigint
klibcpp
kedixa's Cplusplus Library(timer, multiarray, unsigned_bigint, bigint, rational)
Stars: ✭ 17 (-15%)
Mutual labels:  biginteger, bigint
Mockswift
MockSwift is a Mock library written in Swift.
Stars: ✭ 56 (+180%)
Mutual labels:  playground, swift-package-manager
createml-playgrounds
Create ML playgrounds for building machine learning models. For developers and data scientists.
Stars: ✭ 82 (+310%)
Mutual labels:  playground
Miles
Swift Playground that creates jazz improvisations (WWDC 2018)
Stars: ✭ 31 (+55%)
Mutual labels:  playground
Table
CLI tables in Swift
Stars: ✭ 53 (+165%)
Mutual labels:  swift-package-manager
Cider
The Missing Apple Music SDK. Written in Swift.
Stars: ✭ 57 (+185%)
Mutual labels:  swift-package-manager
webpack-playground
No description or website provided.
Stars: ✭ 16 (-20%)
Mutual labels:  playground
break infinity.js
A replacement for decimal.js for incremental games who want to deal with very large numbers (bigger in magnitude than 1e308, up to as much as 1e(9e15) ) and want to prioritize speed over accuracy.
Stars: ✭ 145 (+625%)
Mutual labels:  biginteger
Swift-FFDB
a Object/Relational Mapping (ORM) support to iOS and MacOS .Since SwiftFFDB is build on top of FMDB.
Stars: ✭ 22 (+10%)
Mutual labels:  swift-package-manager
swift-watch
Watches over your Swift project's source
Stars: ✭ 43 (+115%)
Mutual labels:  swift-package-manager
xcbeautify
A little beautifier tool for xcodebuild
Stars: ✭ 687 (+3335%)
Mutual labels:  swift-package-manager
Match3Kit
Library for simple Match3 games.
Stars: ✭ 38 (+90%)
Mutual labels:  swift-package-manager

UInt256

Build Status Language Platform Carthage Compatible CocoaPods Compatible Coverage Status

A UInt256 library written in Swift 4, inspired by CryptoCoinSwift/UInt256

Features

This library provides a UInt256 struct that conforms nicely to Swift's FixedWidthInteger and UnsignedInteger protocols. According to Apple, the two are the necessary top level protocols for an UInt member: here

It supports a complete set of arithmetic operations, as well as properties and functions that are common to other UInt family members such as UInt64, UInt32, UInt8, etc. The library leverages Karatsuba fast multiplication algorithm, Divide and Conquer division algorithm, Barrett Algorithm for division and other efficient algos for other operators. Other features include integer literal representation (ExpressibleByIntegerLiteral), default description (CustomStringConvertible) and Hashable.

The library is written entirely in Swift 4. It can be installed as a Swift Package, a Carthage package or a CocoaPod. And a playground is also included as a testbench.

Please feel free to submit new feature requests and report issues here on GitHub. 😃

Please use the playground to try out all the features!

Swift Protocol Conformance

The main struct UInt256 conforms strictly to the following protocols:

  • FixedWidthInteger
  • UnsignedInteger
  • BinaryInteger
  • Numeric
  • Comparable
  • Equatable
  • CustomStringConvertible
  • Hashable

Requirements

  • iOS 8.0+ / macOS 10.10+
  • Xcode 8.0+
  • Swift 4

Communication

If you need any help or have a feature request, please open an issue here on GitHub; if you found a bug or want to help with the development, please submit a pull request. All contributions are welcome! 😃

Installation

Carthage

First, make sure have Carthage installed:

brew update
brew install carthage

To integrate this library into your Xcode project, simply put the following line into your carfile:

github "hyugit/UInt256"

Finally, run carthage update to build the framework, and drag the built framework (either UInt256_iOS.framework or UInt256_macOS.framework) into your Xcode project

Swift Package Manager

This library supports Swift Package Manager as well. If you have your swift package config set up already, please add the following line to your Package.swift:

dependencies: [
    .package(url: "https://github.com/hyugit/UInt256.git", from: "4.0.0")
]

CocoaPods

Install CocoaPods following its official guide

To integrate UInt256 into your Xcode project using CocoaPods, specify it in your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
use_frameworks!

target '<Your Target Name>' do
    pod 'UInt256', :git => 'https://github.com/hyugit/UInt256.git'
end

And run pod install afterwards.

Manual installation

You can also add this library manually to your project.

In the terminal, under your top level project directory, add this library as a git submodule by running the following command:

git submodule add https://github.com/hyugit/UInt256.git

Have Xcode open, go to your new UInt256 subdirectory in Finder, drag UInt256.xcodeproj into the project navigator of your project. Remember to embed the framework to your build target.

Next steps...

  • add documentation
  • look into leveraging GPU/Metal
  • benchmark
  • make UInt256 conform to FixedWidthInteger
  • add an example, preferably through a playground
  • add CocoaPods support
  • more tests, test coverage, corner cases, lint, code review
  • automate build and test runs
  • karatsuba multiplication
  • fast modulo, division, and other algos

License

This library is released under the MIT license. Please see LICENSE

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].