;============================================================ ; iron_uuid.hsp — UUID (GUID) 生成 ;============================================================ #ifndef __iron_uuid_hsp__ #define __iron_uuid_hsp__ #module iron_uuid #uselib "rpcrt4.dll" #cfunc _UuidCreate "UuidCreate" var #defcfunc uuid_generate local buf sdim buf, 16 _r = _UuidCreate(buf) ; Format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx return strf("%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x", peek(buf,3),peek(buf,2),peek(buf,1),peek(buf,0), peek(buf,5),peek(buf,4), peek(buf,7),peek(buf,6), peek(buf,8),peek(buf,9), peek(buf,10),peek(buf,11),peek(buf,12),peek(buf,13),peek(buf,14),peek(buf,15)) #global #endif