Is there a way to generate GUID v1 (time-based) in Delphi 5? I found this function...
unit ComObj;
function CreateClassID: string;
But I'm not sure if it generates a time-based GUID. Also I know about this...
SysUtils.CreateGUID(newGUID);
... which calls the Windows API CoCreateGUID
that produces the GUID version 4 (random).
Similar to how CreateGUID is implemented - using UuidCreateSequential:
uses
Windows;
function UuidCreateSequential(out guid: TGUID): Longint; stdcall; external 'rpcrt4.dll' name 'UuidCreateSequential';
function CreateGUID_V1(out Guid: TGUID): HResult;
begin
Result := HResultFromWin32(UuidCreateSequential(Guid));
end;
I don't have Delphi 5 here so not sure if everything being used here was available 20 years ago.
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