31.05.2015, 15:24
Hey guys I want to make a password hash on php page. How can I make this. Please help me..
Codes:
Hash Function
index.php
hash.php
Codes:
Hash Function
Код:
<php? function udb_hash($buf) { $length=strlen($buf); $s1 = 1; $s2 = 0; for($n=0; $n<$length; $n++) { $s1 = ($s1 + ord($buf[$n])) % 65521; $s2 = ($s2 + $s1) % 65521; } return ($s2 << 16) + $s1; ?>
index.php
Код:
<html> <body> <form action="hash.php" method="post"> Text for Hash: <input type="text" name="name"><br> <input type="submit"> </form> </body> </html>
hash.php
Код:
<html> <body> Hash: <?php echo $_POST["name"]; ?> </body> </html>