Universally Unique Lexicographically Sortable Identifier
import ULID
platforms: [
.macOS(.v10_12)
],
dependencies: [
.package(url: "https://github.com/std-swift/ULID.git",
from: "1.0.0")
],
targets: [
.target(
name: "",
dependencies: [
"ULID"
]),
]
ULID
ULID
conforms to Equatable
, Comparable
, Hashable
, Codable
, and LosslessStringConvertible
Initialize the raw data:
init(rawTime: (high: UInt32, low: UInt16), random: (UInt16, UInt32, UInt32))
Initialize with a Time
and data
init(time: Time = Clock.realtime.now(), random: (Int) -> (UInt16, UInt32, UInt32))
init(time: Time = Clock.realtime.now(), random: @autoclosure () -> (UInt16, UInt32, UInt32))
Initialize with a Time
and random data
init(time: Time = Clock.realtime.now())
init<T: RandomNumberGenerator>(time: Time = Clock.realtime.now(), generator: inout T)
Get time and random data from a ULID
ulid.time: Time
ulid.rawTime: (high: UInt32, low: UInt16)
ulid.random: (UInt16, UInt32, UInt32)
link |
Stars: 1 |
Last commit: 4 years ago |
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics