protected generateToken ( $publicKey, $privateKey, $alphabet, $tokenLength, $caseSensitive ) : string | ||
return | string | the token generated. |
protected function generateToken($publicKey, $privateKey, $alphabet, $tokenLength, $caseSensitive)
{
$token = substr($this->hash2string(md5($publicKey . $privateKey), $alphabet) . $this->hash2string(md5($privateKey . $publicKey), $alphabet), 0, $tokenLength);
return $caseSensitive ? $token : strtoupper($token);
}