wpseek.com
A WordPress-centric search engine for devs and theme authors



wp_hash › WordPress Function

Since2.0.3
Deprecatedn/a
wp_hash ( $data, $scheme = 'auth' )
Parameters: (2)
  • (string) $data Plain text to hash.
    Required: Yes
  • (string) $scheme Authentication scheme (auth, secure_auth, logged_in, nonce).
    Required: No
    Default: 'auth'
Returns:
  • (string) Hash of $data.
Defined at:
Codex:

Gets hash of given string.



Source

function wp_hash( $data, $scheme = 'auth' ) {
		$salt = wp_salt( $scheme );

		return hash_hmac( 'md5', $data, $salt );
	}
endif;

if ( ! function_exists( 'wp_hash_password' ) ) :
	/**
	 * Creates a hash of a plain text password.
	 *
	 * For integration with other applications, this function can be overwritten to
	 * instead use the other package password hashing algorithm.
	 *
	 * @since 2.5.0
	 *
	 * @global PasswordHash $wp_hasher PHPass object.
	 *
	 * @param string $password Plain text user password to hash.
	 * @return string The hash string of the password.
	 */