Skip to content

Instantly share code, notes, and snippets.

@Natetronn
Created August 9, 2013 19:05
Show Gist options
  • Select an option

  • Save Natetronn/6196244 to your computer and use it in GitHub Desktop.

Select an option

Save Natetronn/6196244 to your computer and use it in GitHub Desktop.
Generate SHA1 hashes for passwords (don't leave this lying around on your live server of course!)
<?php
$passwords = array(
'somepassword',
'anotherpassword',
'onemorepassword'
// so on and so forth (don't forget the trailing commas)
);
// convert passwords to SHA1 hashes
foreach ($passwords as $password) {
echo hash('sha1', $password)."<br>";
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment