--- /dev/null
+<?php\r
+\r
+//CHAR AT POSITION "X"\r
+function charAt($str, $pos) {\r
+\r
+$pos = ($pos - 1); //Offset\r
+return (substr($str, $pos, 1)) ? substr($str, $pos, 1) : -1;\r
+\r
+}\r
+\r
+//NEXT CHARACTER\r
+function nextChar ( $in ) {\r
+\r
+$chars = ("abcdefghijklmnopqrstuvwxyz "); // Ends with space\r
+//echo(charAt($chars, 7)); //Debug\r
+$len = (strlen($chars));\r
+\r
+$char = $in;\r
+\r
+$charpos = ( strpos($chars, $char) );\r
+$newcharpos = ($charpos + 1);\r
+$char = $chars[$newcharpos];\r
+\r
+$out = $char;\r
+return ($out); //Returns "" after last character.\r
+\r
+}\r
+\r
+//BRUTE FORCER\r
+function bruteForce ( $word ) {\r
+\r
+$first = ("a");\r
+$prelast = ("z");\r
+$last = (" ");\r
+\r
+$wpos = 0;\r
+\r
+while ( $word[$wpos] == $prelast ) {\r
+ $wpos = ($wpos + 1);\r
+}\r
+\r
+$word[$wpos] = nextChar($word[$wpos]);\r
+\r
+/*\r
+while ( $word[$wpos] != $prelast ) {\r
+ $word[$wpos] = nextChar($word[$wpos]);\r
+ if ( $word[$wpos] == $last ) {\r
+ $word[$wpos] = $prelast;\r
+ }\r
+}\r
+*/\r
+\r
+return $word;\r
+}\r
+\r
+\r
+\r
+//===CODE===\r
+\r
+//$test = ("nazdar");\r
+//echo ($test["2"]);\r
+//die();\r
+\r
+echo(nextChar ("d") . "\n");\r
+echo(bruteForce ("ahoj") . "\n----------------------\n\n");\r
+\r
+$ted = ("a");\r
+while (1) {\r
+echo($ted."\n");\r
+$ted = bruteForce($ted);\r
+}\r
+\r
+/*\r
+$hash = ("79c2b46ce2594ecbcb5b73e928345492");\r
+$pass = ("ahoj");\r
+//echo(md5("ahoj"));\r
+\r
+$loop = 1;\r
+while($loop) {\r
+\r
+$now = $pass;\r
+\r
+ if ( md5($now) == $hash ) {\r
+ die ("Hash: $hash\nVysledek: $now\n");\r
+ }\r
+\r
+}\r
+*/\r
+\r
+?>\r