title: Script to generate unique token
body: <p>I need generate a public key and secret key.</p>
  
  <p>Is the following code would be enough?</p>
  
  <pre><code>&lt;?php
  
  function genToken($salt) {
      $secret = openssl_random_pseudo_bytes(16);
  
      $apiKey = hash_hmac('sha256', $salt, $secret);
      $apiKey = base64_encode($apiKey);
      $apiKey = str_replace('=', '', $apiKey);
  
      return $apiKey;
  }
  
  $salt = 'UsernameEmail@gmail.com';
  echo 'pk_' . genToken($salt);
  echo "\n";
  echo 'sk_' . genToken($salt);
  echo "\n";
  </code></pre>