-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generated ksuids are not portable #2
Comments
Hi @kosprov. Thank you for bringing this to my attention. I'll take a deeper look at this. Cheers! |
Hi @kosprov. What is the epoch time set to in your Go implementation? Something to keep in mind is that there is a subtract operation performed on the generated timestamp prior to Base62 conversion. Another point to note is that the Base62 conversion in the Go implementation have the ASCII characters in a different order. Just some thoughts. Thank you. |
I used the original Go implementation from Segment and a JavaScript implementation. Those two are interoperable. Both use the epoch mentioned in the blog post (14e8 seconds / 14e11 millis) |
Thank you for the solution references. While interoperability with other implementations was not an original goal, I can see its value. As time permits, I'll work towards making this library compatible with other implementations starting with the ones you have referenced. Cheers! |
Hi @kosprov. I've published a version of this library to Maven Central that should generate identifiers that are portable. Since this is a breaking change, I am incrementing the version number to a 2.x.x release. I'd like your feedback. When possible, can you please test the new version and compare your results to the Go and Node.js implementations then report back if the changes are acceptable? In Maven Central, you can find the build as version Thank you. |
I'm not the one who asked for it originally but I can confirm that with |
Hi,
I just used the original Go implementation to create a KSUID and I got:
The Java implementation gave me:
The timestamp part is clearly not similar even though they were generated seconds apart.
When I try to parse
1GZvgyPvVmuiQMTuzkEtKSogs2V
with the Java implementation I get:Similarly, when I parse
COH2CXgKpgJ9Bvn8SF1xUa9CeTt
with the Go implementation I get:This library must be interoperable with other implementations.
The text was updated successfully, but these errors were encountered: