wp_hash() WordPress Function
The wp_hash() function is used to create a hash of a given string. This function is used by the WordPress software to create password hashes.
wp_hash( string $data, string $scheme = 'auth' ) #
Get hash of given string.
Parameters
- $data
(string)(Required)Plain text to hash
- $scheme
(string)(Optional)Authentication scheme (auth, secure_auth, logged_in, nonce)
Default value: 'auth'
Return
(string) Hash of $data
More Information
Usage:
wp_hash( $data, $scheme );
Notes:
Source
File: wp-includes/pluggable.php
function wp_hash( $data, $scheme = 'auth' ) { $salt = wp_salt( $scheme ); return hash_hmac( 'md5', $data, $salt ); }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
2.0.3 | Introduced. |