Phpfox_Hash

Description

Random Hash Creator Creates a random hash for passwords as well as create a random hash for cookies were X will always have a different hash value due to a random prefix.

Example to create a hashed password:

  1.  Phpfox::getLib('hash')->setHash('password''salt');

  • author: Raymond Benc
  • version: $Id: hash.class.php 1687 2010-07-22 03:13:27Z Raymond_Benc $
  • copyright: [PHPFOX_COPYRIGHT]

Located in /include/library/phpfox/hash/hash.class.php (line 23)


	
			
Method Summary
 Phpfox_Hash __construct ()
 bool getRandomHash (string $sPassword, string $sStoredValue)
 string setHash (string $sPassword, [string $sSalt = ''])
 string setRandomHash (string $sPassword)
Methods
Constructor __construct (line 29)

Class constructor

  • access: public
Phpfox_Hash __construct ()
getRandomHash (line 80)

Verifies if the hash we created earlier with the method setRandomHash() matches.

  • return: TRUE on success, FALSE on failure
  • see: self::setRandomHash()
  • access: public
bool getRandomHash (string $sPassword, string $sStoredValue)
  • string $sPassword: Password or information we need to check with our stored hash
  • string $sStoredValue: Stored sha1 hash. Usually a cookie or session
setHash (line 42)

Creates an MD5 hash with the password itself wrapped in MD5 as well as support for a random salt that is also wrapped in MD5

  • return: Returns a 32 character MD5 string
  • see: md5()
  • access: public
string setHash (string $sPassword, [string $sSalt = ''])
  • string $sPassword: Password to create a hash for
  • string $sSalt: Optional random salt to make the hash unique
setRandomHash (line 61)

Creates a random hash for a password that needs to be set in a public state, usually a session or a cookie

  • return: Returns a sha1 string
  • see: sha1()
  • see: md5()
  • access: public
string setRandomHash (string $sPassword)
  • string $sPassword: Password or information we need to create a hash for

Documentation generated on Tue, 28 Sep 2010 10:36:40 +0200 by phpDocumentor 1.4.0a2