wp_hash( string $data, string $scheme = 'auth' )

Get hash of given string.


Parameters Parameters

$data

(string) (Required) Plain text to hash

$scheme

(string) (Optional) Authentication scheme (auth, secure_auth, logged_in, nonce)

Default value: 'auth'


Top ↑

Return Return

(string) Hash of $data


Top ↑

More Information More Information

Usage:
wp_hash( $data, $scheme );
Notes:
  • This function can be replaced via plugins. If plugins do not redefine these functions, then this will be used instead.
  • Uses: wp_salt() Get WordPress salt.

Top ↑

Source Source

File: wp-includes/pluggable.php

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

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


Top ↑

Changelog Changelog

Changelog
Version Description
2.0.3 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.