FWDekker / intellij-randomness

IntelliJ plugin for inserting random numbers, UUIDs, names, IP addresses, and much more
https://plugins.jetbrains.com/plugin/9836-randomness
MIT License
45 stars 7 forks source link

Extend UUID Generation to Include Versions #513

Closed JiangHongTiao closed 8 months ago

JiangHongTiao commented 8 months ago

Hello Randomness Team,

I'm a user of your Randomness plugin for IntelliJ IDEA, and it's been immensely helpful in my development workflow. I appreciate the simplicity and effectiveness of the plugin, especially for generating UUIDs.

However, I have encountered a scenario where I need more flexibility in UUID generation. Specifically, I'm working on a project that requires UUID version 7 (v7), which isn't currently supported by the plugin.

Feature Request I propose an enhancement to the UUID generation feature of the Randomness plugin. It would be highly beneficial if the plugin could support additional UUID versions, specifically v6, v7, and v8. These versions are increasingly being adopted in various projects and having them available in Randomness would be a significant improvement.

UUID v6: Designed for better performance with databases. UUID v7: Offers a monotonic, time-based solution. UUID v8: Provides custom UUID formats for specialized use cases.

Implementation Suggestion Adding a setting in the UUID generation section where users can select the version of UUID they wish to generate. This feature would be particularly beneficial for projects like mine, which require use of specific UUID version.

Thank you for considering this enhancement. Your work on this plugin is greatly appreciated, and this feature would undoubtedly make it even more valuable to the IntelliJ IDEA community.

Best regards, Juraj

FWDekker commented 8 months ago

Good idea! This should be easy enough to implement, since the underlying library that generates the UUIDs already supports v6 and v7.

As for v8 UUIDs, until cowtowncoder/java-uuid-generator#47 is implemented, Randomness would have to generate v8 UUIDs without library code; perhaps just generate v4 UUIDs and replace the version bits?

FWDekker commented 8 months ago

UUID versions 6, 7, and 8 have been added in #514 and will be included in Randomness v3.2.0. I aim to release this version next week or the week after; there's also a bunch of smaller changes I want to include in that release.

Let me know if there's anything else I can do. Suggestions are always welcome!

JiangHongTiao commented 8 months ago

Thank you a lot Florine, that was super quick! I'm already looking forward to test it out! If something else cross my mind, I'll let you know :) Thanks for all your work, your extension is super helpful to me, especially in column-mode.

FWDekker commented 8 months ago

I've released v3.2.0, which includes the new UUID versions. It usually takes one or two working days before JetBrains approves a plugin update, after which you can update Randomness in your IDE. If you cannot wait until then, the release can also be downloaded from GitHub.

JiangHongTiao commented 8 months ago

It's available :) Many thanks Florine! image