pentagonal/phpass
最新稳定版本:1.1.0
Composer 安装命令:
composer require pentagonal/phpass
包简介
PHP password hashing library original by open wall PhPass
README 文档
README
Script base on OpenWall's PhPass, based on the 0.3 release, change to ready for:
- Name Space
- Composer (Autoload)
- PHP 5
- Unit Tested
There was make some changes and add 2 methods & Name Space , to make the password hash could use install on composer and Name Space Support.
We are not claim of the projects, but we just add some comments and make more compatible with new version of PHP for our projects.
Change & Additional
VERSION 1.1.0
- Add 1 static method `isMaybeHash` for checking is hashed string
- Add `VERSION` constant
VERSION 1.0
- Dump version to 1.0.0
- Add Comments
- Adding visibility on methods & property
- Add 2 methods alternative `verify` & `hash`
- Remove /dev/urandom , that maybe thrown of error as random state ( default uses loop )
Installation
Add requirement to the composer.json file and run composer install:
{
"require": {
"pentagonal/phpass": "1.1"
}
}
Usage
<?php /** * Require Autoload From Vendor */ require_once(__DIR__ . "/vendor/autoload.php"); /** * Initiate of PasswordHash * @type Object instance of \Pentagonal\PhPass\PasswordHash */ $passwordHash = new \Pentagonal\PhPass\PasswordHash(); /** * Hash the string of password * @uses \Pentagonal\PhPass\PasswordHash::hashPassword([string] password) | or use hash([string] password) as another method aliases * @type string */ $hashedPassword = $passwordHash->hashPassword('The String Plain Text Password'); /** * Check password match * @uses \Pentagonal\PhPass\PasswordHash::checkPassword([string] password, [string] hashedPassword) | or use check([string] password, [string] hashedPassword) as another method aliases * @type string */ $isPasswordMatch = $passwordHash->checkPassword('The String Plain Text Password', $hashedPassword); /** * Check if string maybe hashed */ $isHashed = Pentagonal\PhPass\PasswordHash::isMaybeHash($hashedPassword);
统计信息
- 总下载量: 1.59k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 12
- 点击次数: 3
- 依赖项目数: 1
- 推荐数: 1
其他信息
- 授权协议: Public
- 更新时间: 2016-03-31