You are here

function _access_unpublished_get_hash_from_nodeid in Access unpublished 7

Generate hash from node ID.

Parameters

int $nid: Node ID, nid.

Return value

string Base-64 encoded, URL-safe sha-256 hash based on node ID.

2 calls to _access_unpublished_get_hash_from_nodeid()
_access_unpublished_check_hash in ./access_unpublished.module
Check whether a hash is present in the current URL, and if so, verify that the hash is correct.
_access_unpublished_show_hashed_link in ./access_unpublished.module
Display the hashed link to the end user.

File

./access_unpublished.module, line 105
Drupal module: Access unpublished.

Code

function _access_unpublished_get_hash_from_nodeid($nid) {
  return drupal_hash_base64(drupal_get_private_key() . $nid);
}