llGenerateKey
Revision as of 10:05, 2 September 2008 by Haravikk Mistral (talk | contribs) (New page: {{LSL_Function |func=generateKey |func_desc=Generates a key using Type 3 (MD5) UUID generation to create a unique key using region-name, object-key, service and variable. |return_type=key ...)
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
key timeKey = generateKey("time", (string)llGetUnixTime());
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>