A class to hash and verify passwords using verious methods
category | OSS |
---|---|
package | OSS_Auth |
copyright | Copyright (c) 2007 - 2012, Open Source Solutions Limited, Dublin, Ireland |
license | New BSD License |
hash(string $pw, array $config) : string
The parameters expected in $config
are:
pwhash
- a hashing method from the HASH_
constants in this classhash_cost
- a cost parameter for certain hashing functions - e.g. bcrypt (defaults to 9)string
The plaintext password to hash
array
The resources.auth.oss array from application.ini
\OSS_Exception |
---|
string
The hashed passwordverify(string $pwplain, string $pwhash, array $config) : bool
see | \global\hash() |
---|
string
The plaintext password
string
The hashed password to use for verification
array
The resources.auth.oss array from application.ini
\OSS_Exception |
---|
bool
True if the passwords matchHASH_BCRYPT
HASH_PLAIN
HASH_PLAINTEXT
HASH_UNKNOWN