Delphi UUID generator

前端 未结 4 1898
野的像风
野的像风 2021-02-05 00:28

Does Delphi have anything built-in to generate UUIDs?

4条回答
  •  离开以前
    2021-02-05 01:09

    If you're using one of the latest version of Delphi, and include SysUtils, you can call TGuid.NewGuid to generate a new guid.

    NewGuid is actually implemented in a helper class for TGuid (TGuidHelper), which is declared in SysUtils.

    This function calls the CreateGUID method (also in SysUtils and already mentioned in the answer by Mitch Wheat), which is actually a cross platform function that calls different libraries depending on the platform it runs on.

提交回复
热议问题