Class Hash

Description

This class provides an generic interface to hashing algorithms

Use this class for generating hashes which don't require any specific hashing algorithm. This makes it possible to transparently switch the hashing algorithm used.

By default uses the hashing algorithm found by the virtual role "hash.method"

Located in /phpsatk-lib/global/org.eenterphace.sat.crypto.hash/hash.php (line 46)


	
			
Variable Summary
Method Summary
string genhash (string $value)
string hashRaw (string $value)
boolean verify (string $hash, string $value)
Variables
HashMethod $instance = null (line 53)

Holds the static instance of the default hashing algorithm

  • static:
Methods
genhash (line 84)

Hashes a given value

Includes a OpenLDAP style prefix {HASH} where hash is the used hash algorithm.

  • access: public
  • static:
string genhash (string $value)
  • string $value: Value to hash
getInstance (line 68)

Gets a singleton instance of the standard hash algorithm implementation

  • access: public
  • static:
HashMethod getInstance ()
hashRaw (line 96)

Get the plain output of the used hash method

This means prefixes for hash detection will not be included

  • access: public
  • static:
string hashRaw (string $value)
  • string $value: Value to hash
verify (line 114)

Verifies a hash

If available uses a hash algorithm proposed by the hash itself (using a {hashname} prefix} determines the module to use by the "hash.<hashname>" virtual role.

Be careful when using salted hashs because modules for the same type of hash might use different salt lengths and methods resulting in incompatible hashes - meaning always bind salted hash modules to their role and don't switch them.

  • access: public
  • static:
boolean verify (string $hash, string $value)
  • string $hash: Hash value
  • string $value: Original value

Documentation generated on Mon, 21 May 2007 10:35:05 +0200 by phpDocumentor 1.3.0RC5