Share My Creation [B4X][UUIDv7] Class UUID generation for version 7

This class generates cross-platform UUIDv7, without external libraries.

It's a UUID version 7 implementation that combines:

🕒 48-bit timestamp (time-sortable)
🎲 80 random/monotonic bits generated with SecureRandom
🔢 Correct version and variant according to RFC 4122
âš¡ Monotonic: prevents duplicates if multiple UUIDs are generated in the same millisecond
💻 Cross-platform: works on B4A, B4J, and B4i
📦 Standard output: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

It's secure, sortable, reliable, and production-ready—much more secure than using Rnd() to generate UUIDs.

Regards

The following files are attached: class and example.
1772587669481.png
 

Attachments

  • UUIDv7.bas
    2.7 KB · Views: 14
  • UUIDv7.zip
    3.9 KB · Views: 13
Top