At 3/4/08 11:17 AM, Swirling-Venom wrote:
md5(arg) is a pretty simple function to use =(
At 3/4/08 01:02 PM, SweetSkater wrote:
What's that?
MD5 is a member of the MD line of one-way encryption algorithms that generates a 32 character hexidecimal string of numbers (a hash) after passing in a string. It'll always generate the same code each time for the same argument, and used to be used for security (say, your password would have a "salt" (extra characters kept secret by the organisation) and encoded, before being sent from Alice down the network to be compared with the password+salt on Bob, so that any Eves will only see the string of characters (which is obviously NOT your password).
Since they proved that the algorithm isn't infallable (it collides... all these buzzwords are a Wiki search away), the use of MD5 was phased back in favour of the SHA1 function, but it still remains a popular tool.
There IS an MD5 function in Flash. Lots of people have built it as a class or function for AS2 and 3. MD5 will always generate a fairly unique 32 character string based on any string you put into it, no matter its length. So a good uploader would do something clever like MD5ing your filename, and putting it as a unique URL (like say, 20080304_9e107d9d372bb6826bd81d3542a419d 6.php), and make it just a tiny bit harder for people to find your files, since they'd have to know you submitted a piece entitled The Quick Brown Fox Jumped Over The Lazy Dog on the 4th of March 2008 to find it...
Personally I like MD5 because it'll generate 32 values of 1-16. I can't think of a faster way to generate a reliable RPG statline based on a user's Character Name...