SmartGuid32 not in Primary Key

Hi,
I want to assign a SmartGuid32 in a entity for a secondary index. The Id is already a sequence assigned by the 'classic' [ID('myID', TIdGenerator.IdentityorSequence)] and the [Sequence] attribute.
But I need also to assign SmartGuid32 for another field.
Actually there is no a default value that can be assigned via attribute for inserting,updating, so I must use oninserting event.
My question is: What Aurelius internal function I can use for assign a SmartGuid32 in the event code, without using another "external" function?
Thanks in advance

You said yourself, you should use the OnInserting event and the value of the property there. Or you can even do it in the class Create constructor (or in an overriden AfterConstruction method), depends on your business logic.

Maybe my introduction was too long :-)
Okay for oninserting event, I just want an example of the code for assigning the Smartguid32 to one of my properties, in the sense of which unit to use and which direct function to call from the ready-made Aurelius functions, without adding my own further functions for the calculation of the Smart guid. I just need an example line, without looking in the code for the functions that Aurelius uses :-)
Ex. My32CharGuid := ????

Ah ok. Well, the code is in Aurelius.Id.Guid unit, but sorry it's not isolated enough to be used from outside Aurelius id generator.

But the code is as simple as:

uses Aurelius.Global.Utils;

  S := TUtils.GuidToVariant(TUtils.NewSequentialGuid(TSequentialGuidMode.SequentialAsString);
  S := Copy(S, 2, 8) + Copy(S, 11, 4) + Copy(S, 16, 4) + Copy(S, 21, 4) + Copy(S, 26, 12);
  Result := S;

If you are using MS SQL Server change TSequentialGuidMode.SequentialAsString to TSequentialGuidMode.SequentialAtEnd.

Hi,
in the meantime I have extracted this code from Aurelius:

function GenerateSG32Id: Variant;
var
S: string;
begin
S := TUtils.GuidToVariant(TUtils.NewSequentialGuid(TSequentialGuidMode.SequentialAsString));
S := Copy(S, 2, 8) + Copy(S, 11, 4) + Copy(S, 16, 4) + Copy(S, 21, 4) + Copy(S, 26, 12);
Result := S;
end;
Exactly the same code (for Postgres/ Firebird databases) :-)

Is there a performance difference or other valid reason to use LowerCase or not? (out of my curiosity)

Thanks for the Help!

No, that's just personal taste. Well, of course, calling Lowercase makes it slower as it's an additional string processing, but I doubt this will have real-world impact.