You are here

function simplenews_statistics_encoder_install in Simplenews Statistics 7

Same name and namespace in other branches
  1. 7.2 simplenews_statistics_encoder/simplenews_statistics_encoder.install \simplenews_statistics_encoder_install()

Implements hook_install().

File

simplenews_statistics_encoder/simplenews_statistics_encoder.install, line 11
Simplenews statistics encoder (un)install and updates file.

Code

function simplenews_statistics_encoder_install() {

  // Generate a very random number as salt.
  $min = rand(0, 100);
  $max = rand($min, 1000);
  $salt = rand($min, $max);
  variable_set('simplenews_statistics_encoder_salt', $salt);

  // Generate a 32 character identifier (a 128 bit hex number).
  $key = md5(uniqid(rand()));
  variable_set('simplenews_statistics_encoder_private_key', $key);
}