Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Drupal7 Password Hasher Laravel Package

selfsimilar/drupal7_password_hasher

PHP package for verifying and generating Drupal 7-compatible password hashes. Useful for migrating users to Laravel or other apps while preserving existing credentials, with support for Drupal’s phpass-based hashing format and validation against stored hashes.

View on GitHub
Deep Wiki
Context7

Drupal 7 Password Hasher

Build Status

This is the Drupal 7 password hasher code, reformatted in to a PSR-4 compliant library class for use in PHP projects that need to import legacy Drupal 7 user accounts. Drupal 7 is licensed under the GPLv3, and as this borrows directly from that code, I have licensed this code similarly. Thanks to HauteLook for the Modernized Openwall Phpass package for inspiration.

Usage

<?php

namespace Your\Namespace;

use Selfsimilar\D7PasswordHasher\Hasher;

require_once(__DIR__ . "/vendor/autoload.php");

// Constructor take the iteration count for number of cycles to hash, but by
// default uses the Drupal 7 stock number. You may need to check your Drupal 7
// installation for the value of `password_count_log2` (e.g. `drush
// variable-get password_count_log2`). If it is set and different than 15,
// you will need to pass it to the Hasher() constructor.
$passwordHasher = new Hasher();

$password = $passwordHasher->HashPassword('secret');
var_dump($password);

$passwordMatch = $passwordHasher->CheckPassword('secret',
  "$2a$08$0RK6Yw6j9kSIXrrEOc3dwuDPQuT78HgR0S3/ghOFDEpOGpOkARoSu");
var_dump($passwordMatch);
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
terminal42/code-quality-tools
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky