ksuid

A Java port of Segment's K-Sortable Globally Unique IDs library written in Go.

License

License

GroupId

GroupId

com.amirkhawaja
ArtifactId

ArtifactId

ksuid
Last Version

Last Version

2.0.0-RC1
Release Date

Release Date

Type

Type

jar
Description

Description

ksuid
A Java port of Segment's K-Sortable Globally Unique IDs library written in Go.
Project URL

Project URL

https://github.com/akhawaja/redisrqs-java
Source Code Management

Source Code Management

https://github.com/akhawaja/ksuid

Download ksuid

How to add to project

<!-- https://jarcasting.com/artifacts/com.amirkhawaja/ksuid/ -->
<dependency>
    <groupId>com.amirkhawaja</groupId>
    <artifactId>ksuid</artifactId>
    <version>2.0.0-RC1</version>
</dependency>
// https://jarcasting.com/artifacts/com.amirkhawaja/ksuid/
implementation 'com.amirkhawaja:ksuid:2.0.0-RC1'
// https://jarcasting.com/artifacts/com.amirkhawaja/ksuid/
implementation ("com.amirkhawaja:ksuid:2.0.0-RC1")
'com.amirkhawaja:ksuid:jar:2.0.0-RC1'
<dependency org="com.amirkhawaja" name="ksuid" rev="2.0.0-RC1">
  <artifact name="ksuid" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.amirkhawaja', module='ksuid', version='2.0.0-RC1')
)
libraryDependencies += "com.amirkhawaja" % "ksuid" % "2.0.0-RC1"
[com.amirkhawaja/ksuid "2.0.0-RC1"]

Dependencies

test (2)

Group / Artifact Type Version
junit : junit jar 4.12
org.hamcrest : hamcrest-library jar 1.3

Project Modules

There are no modules declared in this project.

ksuid - Java Version

A Java implementation of the Segment's KSUID library. For a full treatment of why this came about, you can read the blog post on their website.

Maven Central

This library can be downloaded from Maven Central by adding the following as a dependency in your pom.xml file:

<dependency>
    <groupId>com.amirkhawaja</groupId>
    <artifactId>ksuid</artifactId>
    <version>1.0.0</version>
</dependency>

Quick Start

final Ksuid ksuid = new Ksuid();
final String uid = ksuid.generate();
// e.g. output: Be785NYYxP29BJiAJPupfsXuGpR

final String decoded = ksuid.parse(uid);
// e.g. output: Time: 2017-07-08T21:13:08Z[UTC]
//              Timestamp: 1499548388
//              Payload: [-42, 24, -60, -3, -66, 38, 32, 9, 62, -22, 95, -79, 123, -122, -91, 0] 

History

  • 1.0.0: Initial public release.

Versions

Version
2.0.0-RC1
1.0.0