WP_Session_Tokens::hash_token( string $token ): string

In this article

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.

Hashes the given session token for storage.

Parameters

$tokenstringrequired
Session token to hash.

Return

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

Source

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

Changelog

VersionDescription
4.0.0Introduced.

User Contributed Notes

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