UUIDv7 library and demo lazarus / 16-Databases ---------------------------------------------------------------------- Thaddy · 2025-04-28 09:23 I have written a small, cross-platform, fully rfc compliant implementation for the UUIDv7 time sortable UUID format. This is an increasingly important UUID format and used in many distributed database applications. E.g. Amazon and PostGreSQL support it through TLE's Includes a demo and a library with lots of documentation. Example output:Code: [Select]Original time: 2025-04-28 09:25:25.303 Generated UUID: {01967BB7-30B8-747A-9F53-08EBCA9659CD} Is valid UUIDv7?: TRUE Extracted time: 2025-04-28 09:25:25.304 Difference (ms): 1 Generated UUID: {01967BB7-30B9-706F-B8F9-C8716A81A18A} Is valid UUIDv7?: TRUE Extracted time: 2025-04-28 09:25:25.305 Difference (ms): 2 Generated UUID: {01967BB7-30BA-7861-9532-AFB1574F628F} Is valid UUIDv7?: TRUE Extracted time: 2025-04-28 09:25:25.306 Difference (ms): 3 Note this is much smaller and validates better than some other code. ---------------------------------------------------------------------- cdbc · 2025-04-28 09:33 Hi Thaddy Cool, but where is it?!? Regards Benny Sorry my bad flew right over the bottom... ---------------------------------------------------------------------- Thaddy · 2025-04-28 09:38 The attachment disappeared, corrected. I wrote it mainly because all other implementations were frustratingly over-complex and did not always validate so I reduced all handling you need to less than a 100 lines of code that does always validate.