Take the 4x 32-bit integers that are encoded as a hexadecimal string, split them up.

So from the return value of md5("22210219642164014968YMM8C_H7KCQ2S_KL"); you get "ec4917aa5b3017159e3947f8ff981604"
and from this you get 4 integers: 0xec4917aa, 0x5b301715, 0x9e3947f8 and 0xff981604... Hexadecimal is just another way to encode numbers (binary, octal, decimal is the one we use, and hexadecimal). If you don't understand it, then read about it. If you don't understand big/little endian, then read about it.

If you don't know about $base, now's the time to learn. You can usually find these in the mIRC help file. Type /help $base.

edit: ok the mIRC help files aren't always helpful. $base is used to convert between number systems. $base(15,10,16) <-- convert the number 15 from base 10 (decimal) to base 16 (hexidecimal)... It can also pad with zeros: $base(F,16,10,32)

Splitting it up into 4 hexadecimal encoded integers:
Use $base to pad the MD5 out to 32 digits (the term "read mIRC help files" shall be shortened to read). Use $mid to split them up into 4 sections, 8 hexadecimal digits each (read).

If you've read, you'll have some idea how to convert your 4 x hex numbers into decimal. This is where the "little endian" stuff comes into play. If you don't know what "little endian" is, yet, then read (wikipedia should help here). You just so happen to be in luck, but please, read nonetheless. Reading is one of the activities one participates in to become less stupid. Use $and to binary AND them (don't listen to their "logical AND" bs - they meant binary AND).

Last edited by s00p; 05/10/09 02:08 AM.