Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

WP_Session_Tokens::hash_token() WordPress Method

The WP_Session_Tokens::hash_token() method is used to generate a hash of a given session token. This can be used to verify that a given session token is valid.

WP_Session_Tokens::hash_token( string $token ) #

Hashes the given session token for storage.


Parameters

$token

(string)(Required)Session token to hash.


Top ↑

Return

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


Top ↑

Source

File: wp-includes/class-wp-session-tokens.php

	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 );
		}
	}


Top ↑

Changelog

Changelog
VersionDescription
4.0.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.