swift-typeid

1.0.0

Implementation of the typeid type in Swift.
Frizlab/swift-typeid

What's New

TypeID 1.0

2025-03-18T08:13:27Z

🪪 swift-typeid

Compatible from Swift 5.5 to 6. Compatible with macOS, iOS, visionOS, tvOS and watchOS. Compatible with Linux, Windows, WASI and Android.

An implementation of typeid in Swift.

Usage

Example usage of TypeID in a Swift project:

import TypeID

let id = TypeID(prefix: "user")! /* Force-unwrap is valid as we _know_ the prefix “user” is valid. */
print(id.rawValue) /* Will print something like “user_01h4285mqdepf8jrk9e1mjdjm1”. */

let purposefullyImpreciseID = TypeID(prefix: "user", allowedDateDelta: 120)!
/* The resulting ID has a date between now-2min and now+2min. */

Description

  • Swift Tools 5.5.0
View More Packages from this Author

Dependencies

  • None
Last updated: Wed May 14 2025 05:59:48 GMT-0900 (Hawaii-Aleutian Daylight Time)