Advertisement
Altenator_IWnet

Simple STRING TO HASH

Mar 31st, 2012
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.86 KB | None | 0 0
  1. <?php
  2.  
  3. /*
  4.   Simple STRING TO HASH
  5.   Code by Altenator IWnet
  6. */
  7.  
  8. echo "<center><form method='post'>
  9. Insert STRING Here : <input type='text' name='hash_input' value='' /><br><br>
  10. <input type='submit' name='submit_hash' value='Encode' /><br><br>";
  11.  
  12. if (isset($_POST['submit_hash'])) {
  13.     if (isset($_POST['hash_input'])) {
  14.         $hash_input = $_POST['hash_input'];
  15.         }
  16.  
  17. if ($hash_input=="") {  // show error if nothing inserted in input box
  18.     echo 'Nothing Inserted!';
  19. } else {
  20.     if (isset($hash_input)) {
  21.         foreach (hash_algos() as $hash_setoption) {    // set to use all hash function
  22.         $calculate_hash = hash($hash_setoption, $hash_input, false); // calculate all hash and declare variable
  23.         echo "$hash_setoption&#40;&#34;<font color='#001EFF'>$hash_input</font>&#34;&#41; = &#34;<font color='#5BC740'>$calculate_hash</font>&#34;<br>";   // output
  24.     }
  25.     }
  26. }
  27. }
  28. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement