Go to file
Yasuhiro Hatta 8730e18bc6 Update README.md 2019-01-13 15:12:42 +09:00
Sources Add Copyright 2019-01-13 12:35:37 +09:00
Tests Add a Base32 decode test 2019-01-13 13:01:07 +09:00
ULID.xcodeproj Add codecov badge to README.md 2019-01-12 12:14:44 +09:00
.gitignore Initial commit 2019-01-11 00:12:58 +09:00
.swift-version Add .travis.yml 2019-01-12 11:51:54 +09:00
.travis.yml Add codecov badge to README.md 2019-01-12 12:14:44 +09:00
LICENSE Initial commit 2019-01-11 00:12:58 +09:00
Package.swift Rename 2019-01-11 00:25:44 +09:00
README.md Update README.md 2019-01-13 15:12:42 +09:00
ULID.swift.podspec Add .travis.yml 2019-01-12 11:51:54 +09:00

README.md

ULID.swift

Build Status codecov

Implementation of ULID in Swift.

Usage

Generate ULID

// Generate ULID using current time
let ulid = ULID()

// Get ULID string
let string: String = ulid.ulidString
// Get ULID binary data
let data: Data = ulid.ulidData

Parse ULID

// Parse ULID string
let ulid = ULID(ulidString: "01D0YHEWR9WMPY4NNTPK1MR1TQ")

// Get Timestamp as Date
let timestamp: Date = ulid.timestamp

Installation

CocoaPods

pod 'ULID.swift', '~> 1.0.0'

Carthage

github "yaslab/ULID.swift" ~> 1.0.0

Swift Package Manager

.package(url: "https://github.com/yaslab/ULID.swift.git", .upToNextMinor(from: "1.0.0"))

License

ULID.swift is released under the MIT license. See the LICENSE file for more info.