title: crypt(): No salt parameter was specified. You must use a randomly generated salt and a strong hash function to produce a secure hash
body: <p>I'm using PHP V5.6.16</p>
  
  <p>I'm having this error while trying to create an access token</p>
  
  <pre><code>crypt(): No salt parameter was specified. You must use a randomly generated salt and a strong hash function to produce a secure hash
  </code></pre>
  
  <p>This is the function I'm using.</p>
  
  <pre><code>    /**
       * Generate a token
       * @return string token
       */
     private function getToken()
      {
      $random_id_length = 15;
  
   //generate a random id encrypt it and store it in $rnd_id
      $rnd_id = crypt(uniqid(rand(), CRYPT_EXT_DES));
  
      //to remove any slashes that might have come
      $rnd_id = strip_tags(stripslashes($rnd_id));
  
      //Removing any . or / and reversing the string
      $rnd_id = str_replace(".", "", $rnd_id);
      $rnd_id = strrev(str_replace("/", "", $rnd_id));
  
      //finally I take the first 10 characters from the $rnd_id
      $rnd_id = substr($rnd_id, 0, $random_id_length);
  
      return urldecode($rnd_id);
  }
  </code></pre>
  
  <p>How to fix it?</p>