More ... | Edit History:DiffChanges of UUID生成 between Epoch and 2015/09/11 21:41:21 JST
+ ** UUIDとは + 世界に一つだけの値です。ほとんど被ることのない文字列です。 + + win32apiのRpcrt4.dllを使用しています。 + Windows2000以降で動作します。 + + ** uuid.hsp + {{{ + #ifndef __UUID__ + #define __UUID__ + + #uselib "Rpcrt4.dll" + #func global UuidCreate "UuidCreate" sptr + #func global UuidToString "UuidToStringA" sptr, sptr + #func global RpcStringFree "RpcStringFreeA" sptr + + #module uuid + + #defcfunc uuid_new + + sdim uuid, 4+2+2+1*8 + sdim string, 39 + + result = 0 + + UuidCreate varptr(uuid) + UuidToString varptr(uuid), varptr(result) + + dupptr orig, result, 39, 2 + + repeat 39 + + poke string, cnt, peek(orig, cnt) + + loop + + RpcStringFree varptr(result) + + return string + + #global + + #endif + + // サンプル + mes uuid_new() + }}} |