Hacker News new | ask | show | jobs
by halfmatthalfcat 1876 days ago
I started looking into TSID/KSUID/ULID in order to support cursor based pagination schemes in GraphQL against non-integer based unique id fields (such as uuids or unique string ids).

A couple of notable Java libs:

https://github.com/f4b6a3/ulid-creator

https://github.com/f4b6a3/tsid-creator

https://github.com/akhawaja/ksuid

1 comments

Please don't use the akhawaja ksuid generator for Java unchanged. We used it at my last job until we realized 1. the Base62 code is not thread-safe (it uses a static StringBuilder) and more importantly 2. The epoch used is different from the standard, so the generated ksuid aren't portable.

Use https://github.com/ksuid/ksuid insteads

Good to know, thanks.