Skip to content
/ ksuid Public

Kotlin implementation of KSUID(K-Sortable Globally Unique IDs)

License

Notifications You must be signed in to change notification settings

ondh/ksuid

Repository files navigation

ksuid

A Kotlin implementation of K-Sortable Globally Unique IDs. For more information,you can visit Segment's KSUID library and Segment's Blog.

Quick Start

Kotlin:

val uid = Ksuid().generate()
//GcQhZ5uVHCOuh2zWBDUXPP937NK

val decoded = Ksuid().parse(uid)

val timestamp = Ksuid().getTimestamp(uid)

Java:

String uid = Ksuid.generateUid();

String decoded = Ksuid.parseUid(uid);

long timestamp = Ksuid.getTimestampFromUid(uid);

Thanks

Base62 encode/decode by glowfall

Update Log

  • 1.0.2: update kotlin version
  • 1.0.1: Add static methods for Java
  • 1.0.0: Initial public release

About

Kotlin implementation of KSUID(K-Sortable Globally Unique IDs)

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages