Difference between revisions of "32bit Hash"

From Second Life Wiki
Jump to navigation Jump to search
m (add Note: The Seedable_PRNG example presents MD5 of MD5 of MD5 of ... as pseudo-random numbers)
m (Change example according to LSL naming standard)
Line 1: Line 1:
{{LSL Header}}
{{LSL Header}}
Here's a function to turn a UUID into a integer.
Here's a function to turn an UUID into an integer.


<pre>
<pre>
integer keytoint(string inkey)
integer Key2Integer(string inkey)
{
{
     return (integer)("0x" + llGetSubString(llMD5String(inkey,0), 0, 7));   
     return (integer)("0x" + llGetSubString(llMD5String(inkey,0), 0, 7));   

Revision as of 04:08, 3 October 2007

Here's a function to turn an UUID into an integer.

integer Key2Integer(string inkey)
{
    return (integer)("0x" + llGetSubString(llMD5String(inkey,0), 0, 7));   
}

Note: The Seedable_PRNG example presents MD5 of MD5 of MD5 of ... as pseudo-random numbers