Class Hash

Description

class Hash

This class provides a simple interface to the mhash library. mhash was chosen because it supports a wide variety of hash algorithms. For a complete list of supported hashes, refer to the documentation of mhash.

Located in /hash.class.php (line 20)

Exception
   |
   --PException
      |
      --Hash
Variable Summary
mixed $Hash
Method Summary
boolean CompareCiphertextData (ciphertext $ciphertext, genCiphertext $genCiphertext)
mixed GetBlockSize (hashId $hashId)
string GetHashInfo ()
string GetSalt (bytes $bytes, source $source)
Variables
mixed $Hash (line 22)
  • static:
  • access: private
Methods
CompareCiphertextData (line 108)

function CompareCiphertextData

This method compares the original ciphertext to the generated ciphertext.

  • return: TRUE|FALSE
  • access: public
  • static:
boolean CompareCiphertextData (ciphertext $ciphertext, genCiphertext $genCiphertext)
  • ciphertext $ciphertext: Original ciphertext
  • genCiphertext $genCiphertext: Generated ciphertext
GetBlockSize (line 67)

function GetBlockSize

This method retrieves the block size of the specified hash.

  • return: Block size|FALSE
  • access: public
mixed GetBlockSize (hashId $hashId)
  • hashId $hashId: Hash identifier
GetHashInfo (line 49)

function GetHashInfo

This method displays the hash id, the algorithm and the block size for each hash algorithm supported by the mhash library.

  • return: Hash identifier, algorithm and output size
  • access: public
string GetHashInfo ()
GetInstance (line 33)

function GetInstance

This method instantiates a new object from this class; more specifically, it's a singleton instance.

  • return: object instance
  • static:
  • access: public
Hash GetInstance ()
GetSalt (line 92)

function GetSalt

This method retrieves random bits from a Pseudo-Random Number Generator (PRNG).

  • return: Binary encoded salt
  • access: public
  • static:
string GetSalt (bytes $bytes, source $source)
  • bytes $bytes: Size of salt in bytes
  • source $source: Random source of entropy

Inherited Methods

Inherited From PException

PException::Display()

Documentation generated on Thu, 9 Sep 2004 09:03:35 -0400 by phpDocumentor 1.3.0RC3