Does Delphi have anything built-in to generate UUIDs?
To create a sample GUID, hit CTRL + SHIFT + G in the code editor, this will create a unique GUID value, like this one: ['{B54ED86E-211F-4803-AF46-0586DA66C583}']. Each time you press CTRL + SHIFT + G, you'll get a new Guid value.
Users do not need to rely on a centralized authority to administer GUIDs, as anyone can use a generation algorithm to create a GUID. Individuals and organizations can create GUIDs using a free GUID generator that is available online. An online generator constructs a unique GUID according to RFC 4122.
program Guid; {$APPTYPE CONSOLE} uses SysUtils; var Uid: TGuid; Result: HResult; begin Result := CreateGuid(Uid); if Result = S_OK then WriteLn(GuidToString(Uid)); end.
Under the covers CreateGuid()
calls one of the various APIs, depending on the platform. For example on Windows, it nowadays calls UuidCreate
.
Also, if you need a GUID for an interface declaration, hit ctrl+shift+g in the code editor to insert a GUID at the caret.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With