SCRU128 ID is yet another attempt to supersede UUID for the users who need decentralized, globally unique time-ordered identifiers. SCRU128 is inspired by ULID and KSUID and has the following features:
import Scru128 // generate a new identifier object let x = scru128() print(x) // e.g., "036z951mhjikzik2gsl81gr7l" print(x.byteArray) // as a 128-bit unsigned integer in big-endian byte array // generate a textual representation directly print(scru128String()) // e.g., "036z951mhzx67t63mq9xe6q0j"
See SCRU128 Specification for details.
To add this library to your Xcode project as a dependency, select File > Add Packages and enter the package URL: https://github.com/scru128/swift-scru128
To use this library in a SwiftPM project, add the following line to the dependencies in your Package.swift file:
.package(url: "https://github.com/scru128/swift-scru128", from: "<version>"),
Scru128 as a dependency for your target:
.target( name: "<target>", dependencies: [.product(name: "Scru128", package: "swift-scru128")] )
Licensed under the Apache License, Version 2.0.