Skip to content

Instantly share code, notes, and snippets.

@co3k
Created June 14, 2013 13:08
Show Gist options
  • Save co3k/5781696 to your computer and use it in GitHub Desktop.
Save co3k/5781696 to your computer and use it in GitHub Desktop.
<?php
require_once __DIR__.'/vendor/autoload.php';
$lib = new PasswordLib\PasswordLib();
$hash = $lib->createPasswordHash('tetete', '$6$');
var_dump($hash);
var_dump(date('Y-m-d H:i:s'));
for ($i = 0; $i < 50000; $i++) {
if ($i % 1000 == 0) {
var_dump($i, date('Y-m-d H:i:s'));
}
$boolean = $lib->verifyPasswordHash('tetete', $hash);
}
var_dump($boolean, date('Y-m-d H:i:s'));
@co3k
Copy link
Author

co3k commented Jun 14, 2013

FYI

https://github.com/drupal/drupal/blob/7.x/modules/user/user.install#L142

Drupal stores hashed password string in the following type of column:

  'pass' => array(
    'type' => 'varchar',
    'length' => 128,
    'not null' => TRUE,
    'default' => '',
    'description' => "User's password (hashed).",

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment