Well, i think a good example for newbies at sockets (like myself) - retrieves needed data from the website and echo'es it. Only 13 lines, but it does his job for good ;)
Syntax: /rmd5 [md5 hash]
alias rmd5 $iif($len($1) = 32,sockopen $+(rmd5,$1) www.md5.rednoize.com 80)
on *:SOCKOPEN:rmd5*:{
sockwrite -nt $sockname GET $+(/?q=,$right($sockname,-4)) HTTP/1.1
sockwrite -nt $sockname Host: www.md5.rednoize.com
sockwrite -nt $sockname $crlf
}
on *:SOCKREAD:rmd5*:{
if ($sockerr) return
var %md5.data | sockread %md5.data
if (!%md5.data) return
if ($regml($regex(%md5.data,<div id="result" >(.+)</div>))) { echo -at $v1 | sockclose $sockname }
if (hash-not-found-24 isin %md5.data) { echo -at Sorry, nothing found for $right($sockname,-4) | sockclose $sockname }
}
It actually is, but simplest texts are hashed in databases, so if the script has hashed somewhere word \"oneone\" and added that to database as something like oneone\'s md5=oneone and someone searches for that oneone\'s hash, it can return that the word is oneone.
Though, people are starting using $md5($md5(text)) to increase security - and so and so on, it cannot be dehashed so easily again, it requires again preciselly two times bigger database and has to re-encode every hash to $md5(previous md5), but there are even different ways to protect (like IPB does) $md5(text-user-inputed + SALT), and later on it saves the salt in database for knowledge whether user when logging in is inputted right password.
Damn, why i have to write so long :o