![]() |
||
---|---|---|
Sources | ||
Tests | ||
ULID.xcodeproj | ||
.gitignore | ||
.swift-version | ||
.travis.yml | ||
LICENSE | ||
Package.swift | ||
README.md | ||
ULID.swift.podspec |
README.md
ULID.swift
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.