Class WP_Pass

Description

Located in /includes/class.wp-pass.php (line 4)


	
			
Method Summary
bool check_password (string $password, string $hash, [ $user_id = ''])
string generate_password ([int $length = 12], [bool $special_chars = true])
string hash_password (string $password)
int rand ([int $min = 0], [int $max = 0])
Methods
check_password (line 50)

Checks the plaintext password against the encrypted Password.

Maintains compatibility between old version and the new cookie authentication protocol using PHPass library. The $hash parameter is the encrypted password and the function compares the plain text password when encypted similarly against the already encrypted password to see if they match.

For integration with other applications, this function can be overwritten to instead use the other package password checking algorithm.

  • return: False, if the $password does not match the hashed password
  • since: WP 2.5
  • uses: PasswordHash::CheckPassword
bool check_password (string $password, string $hash, [ $user_id = ''])
  • string $password: Plaintext user's password
  • string $hash: Hash of the user's password to check against.
  • $user_id
generate_password (line 89)

Generates a random password drawn from the defined set of characters

  • return: The random password
  • since: WP 2.5
string generate_password ([int $length = 12], [bool $special_chars = true])
  • int $length: The length of password to generate
  • bool $special_chars: Whether to include standard special characters
hash_password (line 18)

Create a hash (encrypt) of a plain text password.

For integration with other applications, this function can be overwritten to instead use the other package password checking algorithm.

  • return: The hash string of the password
  • since: WP 2.5
  • usedby: WP_Users::set_password() - Used to encrypt the user's password before passing to the database
  • uses: PasswordHash::HashPassword
string hash_password (string $password)
  • string $password: Plain text user password to hash
rand (line 111)

Generates a random number

Not verbatim WordPress, keeps seed value in backpress options.

  • return: A random number between min and max
  • since: WP 2.6.2
int rand ([int $min = 0], [int $max = 0])
  • int $min: Lower limit for the generated number (optional, default is 0)
  • int $max: Upper limit for the generated number (optional, default is 4294967295)

Documentation generated on Fri, 18 May 2012 01:33:53 +0100 by phpDocumentor 1.4.3