WordPress at a glance
function is not described

WP_Session_Tokens::hash_token() private WP 4.0.0

Hashes the given session token for storage.

{} It's a method of the class: WP_Session_Tokens{}

No Hooks.


String. A hash of the session token (a verifier).


// private - for code of main (parent) class only
$result = $this->hash_token( $token );
$token(string) (required)
Session token to hash.


Since 4.0.0 Introduced.

Code of WP_Session_Tokens::hash_token() WP 5.7.1

private function hash_token( $token ) {
	// If ext/hash is not present, use sha1() instead.
	if ( function_exists( 'hash' ) ) {
		return hash( 'sha256', $token );
	} else {
		return sha1( $token );