Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
73 lines (64 sloc) 2.14 KB
<?php
/**
* PHP Password Library
*
* @package PHPassLib\Hashes
* @author Ryan Chouinard <rchouinard@gmail.com>
* @copyright Copyright (c) 2012, Ryan Chouinard
* @license MIT License - http://www.opensource.org/licenses/mit-license.php
* @version 3.0.0-dev
*/
namespace PHPassLib;
/**
* Hashing Module Interface
*
* @package PHPassLib\Hashes
* @author Ryan Chouinard <rchouinard@gmail.com>
* @copyright Copyright (c) 2012, Ryan Chouinard
* @license MIT License - http://www.opensource.org/licenses/mit-license.php
*/
interface Hash
{
/**
* Generate a config string from an array.
*
* @param array $config Array of configuration options.
* @return string Configuration string.
* @throws InvalidArgumentException Throws an InvalidArgumentException if
* any passed-in configuration options are invalid.
*/
public static function genConfig(array $config = array ());
/**
* Parse a config string into an array.
*
* @param string $config Configuration string.
* @return array Array of configuration options or false on failure.
*/
public static function parseConfig($config);
/**
* Generate a password hash using a config string.
*
* @param string $password Password string.
* @param string $config Configuration string.
* @return string Returns the hash string on success. On failure, one of
* *0 or *1 is returned.
*/
public static function genHash($password, $config);
/**
* Generate a password hash using a config string or array.
*
* @param string $password Password string.
* @param string|array $config Optional config string or array of options.
* @return string Returns the hash string on success. On failure, one of
* *0 or *1 is returned.
*/
public static function hash($password, $config = array ());
/**
* Verify a password against a hash string.
*
* @param string $password Password string.
* @param string $hash Hash string.
* @return boolean Returns true if the password matches, false otherwise.
*/
public static function verify($password, $hash);
}
Jump to Line
Something went wrong with that request. Please try again.