llGenerateKey
Revision as of 05:40, 3 September 2008 by Haravikk Mistral (talk | contribs)
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
Summary
Function: key generateKey( string service, string variable );
Generates a key using Type 3 (MD5) UUID generation to create a unique key using region-name, object-key, service and variable.
Returns a key The generated key
• string | service | – | The service, object, function, or whatever else this key may represent. | |
• string | variable | – | Any variable(s) relevant to the service that uniquely distinguish it. |
Examples
<lsl>key timeKey = generateKey("time", (string)llGetUnixTime());</lsl>
Implementation
<lsl>key generateKey(string service, string variable) {
return (key)llInsertString( llInsertString( llInsertString( llInsertString( llMD5String( "secondlife://" + llGetRegionName() + "/" + (string)llGetKey() + "/" + service + "/" + variable, 0 // This is reserved by specification, will // be increased with new/different versions. ), 8, "-" ), 13, "-" ), 18, "-" ), 23, "-" );
}</lsl>