-
Notifications
You must be signed in to change notification settings - Fork 2
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
Please Support Parameterized Length #4
Comments
@thibaultmeyer - FWIW, I was looking at the code and I think this can be made public https://github.com/thibaultmeyer/cuid-java/blob/release/2.0.0/src/main/java/io/github/thibaultmeyer/cuid/CUID.java#L72 for same ... or maybe you would want some init configuration ... let me leave it upon you :) |
Hi @IamManchanda, This is exactly the solution I chose to meet the request. A new version should be available within 1 or 2 hours on Maven Central. |
Great to know @thibaultmeyer 🙏👌🙌 |
@thibaultmeyer - Please don't mind but did you push the release to Maven Central? |
mvnrepository is not "real time", new version will appear in few hours. <dependency>
<groupId>io.github.thibaultmeyer</groupId>
<artifactId>cuid</artifactId>
<version>2.0.1</version>
</dependency> I just try on a dummy project, no problem, IntelliJ download jar from Maven Central.
|
So the change to return a "Parameterized Length" simply involves performing a left trim at |
Thanks @thibaultmeyer ... It's working now since last 24-30 hours... thank you :) |
@JamoCA - Now this library supports both these ways to generate CUID v2 final CUID cuid = CUID.randomCUID2();
System.out.println("CUID (Version 2): " + cuid); // default 24 chars and also final CUID cuid32 = CUID.randomCUID2(32); // or whatever number you wanna add
System.out.println("CUID (Version 2), 32: " + cuid32); // 32 chars PS: I do think Github Readme should be updated to let devs know of this new addition |
Yes I will update the readme |
Done |
Thanks @thibaultmeyer 👍🙏 |
Is your feature request related to a problem? Please describe.
When the use-case is simply something like username or URL disambiguation where you don't need strong uniqueness guarantees.
Describe the solution you'd like
Parameterized Length in CUID 2 https://github.com/paralleldrive/cuid2#parameterized-length
Describe alternatives you've considered
N/A
Additional context
official javascript example of same
The text was updated successfully, but these errors were encountered: