定制 pentagonal/phpass 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

pentagonal/phpass

最新稳定版本:1.1.0

Composer 安装命令:

composer require pentagonal/phpass

包简介

PHP password hashing library original by open wall PhPass

README 文档

README

Build Status

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

GitHub 信息

  • Stars: 12
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Public
  • 更新时间: 2016-03-31

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固