pnicorelli/php-dotnet-password-hasher

php package for hash/validate passwords using the .NET PasswordHasher algorithm.

0.0.1 2018-10-25 15:48 UTC

This package is auto-updated.

Last update: 2024-09-26 05:42:36 UTC


README

PHP package for hash/validate passwords using the .NET PasswordHasher algorithm.

Install

composer require pnicorelli/php-dotnet-password-hasher

Usage

<?php

require("vendor/autoload.php");

use DotNetPasswordHasher\DotNetPasswordHasher;
$hash = DotNetPasswordHasher::hash("CorrectHorseBatteryStaple");

if( DotNetPasswordHasher::verify("CorrectHorseBatteryStaple", $hash) ) {
  // Password match
  echo "yeah!";
} else {
  // Password mismatch
  echo "Nooooo";
}

Test

./vendor/bin/phpunit test/*