Difference between revisions of "LlMD5String"

From Second Life Wiki
Jump to navigation Jump to search
m
m (<lsl> tag to <source>)
Line 12: Line 12:
|constants
|constants
|examples=
|examples=
<lsl>
<source lang="lsl2">
llSay(0, llMD5String("Hello, Avatar!", 0)); // returns 112abd47ceaae1c05a826828650434a6
llSay(0, llMD5String("Hello, Avatar!", 0)); // returns 112abd47ceaae1c05a826828650434a6
</lsl>
</source>


====Linux Example====
====Linux Example====
<pre>
<source lang="bash">
$ echo -n 'Hello, Avatar!:0' | openssl md5
$ echo -n 'Hello, Avatar!:0' | openssl md5
112abd47ceaae1c05a826828650434a6
112abd47ceaae1c05a826828650434a6
</pre>
</source>
|helpers
|helpers
|also_functions=
|also_functions=

Revision as of 12:56, 22 January 2015

Emblem-important-red.png Security Warning!

The MD5 hashing algorithm should not be used because it is too easy to generate collisions (two inputs which result in the same hash). http://www.kb.cert.org/vuls/id/836068

Summary

Function: string llMD5String( string src, integer nonce );
0.0 Forced Delay
10.0 Energy

Returns a string of 32 hex characters that is the "Wikipedia logo"MD5 checksum of src with a "Wikipedia logo"salt of ":"+nonce.

• string src
• integer nonce

Specification

nonce is casted to string, then appended to src after a colon (src + ":" + nonce). This is important to know if you are calculating a hash in another language and wish to compare with one calculated in LSL. It could be written as MD5Hash(src + ":" + nonce)

The character encoding used by llMD5String is the UTF-8 format.

Examples

llSay(0, llMD5String("Hello, Avatar!", 0)); // returns 112abd47ceaae1c05a826828650434a6

Linux Example

$ echo -n 'Hello, Avatar!:0' | openssl md5
112abd47ceaae1c05a826828650434a6

See Also

Functions

•  llSHA1String

Deep Notes

Signature

function string llMD5String( string src, integer nonce );