You are here

function nodejs_generate_content_token in Node.js integration 8

Same name and namespace in other branches
  1. 6 nodejs.module \nodejs_generate_content_token()
  2. 7 nodejs.module \nodejs_generate_content_token()

Generate a token for a piece of content.

1 call to nodejs_generate_content_token()
nodejs_send_content_channel_token in ./nodejs.module
Send a content channel token to Node.js.

File

./nodejs.module, line 22

Code

function nodejs_generate_content_token() {
  return Crypt::hmacBase64(uniqid(mt_rand(), TRUE), \Drupal::service('private_key')
    ->get() . ($hash_salt = Settings::getHashSalt()));
}