original_string: private function generateToken($expired = false)
      {
          $life = $this->tokenConfig['life'];
  
          if (!$expired) {
              $expire = time() + $life;
          } else {
              $expire = time() - ($life * 2);
          }
  
          $generator = new RandomGenerator();
          $tokenString = $generator->randomToken();
  
          $e = PasswordEncryptor::create_for_algorithm('blowfish'); //blowfish isn't URL safe and maybe too long?
          $salt = $e->salt($tokenString);
          $token = $e->encrypt($tokenString, $salt);
  
          return array(
              'token' => substr($token, 7),
              'expire' => $expire,
          );
      }
code: private function generateToken($expired = false)
      {
          $life = $this->tokenConfig['life'];
  
          if (!$expired) {
              $expire = time() + $life;
          } else {
              $expire = time() - ($life * 2);
          }
  
          $generator = new RandomGenerator();
          $tokenString = $generator->randomToken();
  
          $e = PasswordEncryptor::create_for_algorithm('blowfish'); //blowfish isn't URL safe and maybe too long?
          $salt = $e->salt($tokenString);
          $token = $e->encrypt($tokenString, $salt);
  
          return array(
              'token' => substr($token, 7),
              'expire' => $expire,
          );
      }
code_tokens: private function generateToken ( $ expired = false ) { $ life = $ this -> tokenConfig [ 'life' ] ; if ( ! $ expired ) { $ expire = time ( ) + $ life ; } else { $ expire = time ( ) - ( $ life * 2 ) ; } $ generator = new RandomGenerator ( ) ; $ tokenString = $ generator -> randomToken ( ) ; $ e = PasswordEncryptor :: create_for_algorithm ( 'blowfish' ) ; //blowfish isn't URL safe and maybe too long? $ salt = $ e -> salt ( $ tokenString ) ; $ token = $ e -> encrypt ( $ tokenString , $ salt ) ; return array ( 'token' => substr ( $ token , 7 ) , 'expire' => $ expire , ) ; }
docstring: Generates an encrypted random token
  and an expiry date
  
  @param  boolean $expired Set to true to generate an outdated token
  @return array            token data array('token' => HASH, 'expire' => EXPIRY_DATE)
docstring_tokens: Generates an encrypted random token and an expiry date