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.bytes) // 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.
|Last commit: 1 week ago|
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics