Note that output may not be ASCII.
public generateRandomKey ( integer $length = 32 ) : string | ||
$length | integer | the number of bytes to generate |
return | string | the generated random bytes |
public function actionMultiple() { $security = new Security(); $randomString = $security->generateRandomString(); $randomKey = $security->generateRandomKey(); return $this->render('multiple', ['randomString' => $randomString, 'randomKey' => $randomKey]); }
/** * Generates new password reset token */ public function generatePasswordResetToken() { $this->password_reset_token = Security::generateRandomKey() . '_' . time(); }
/** * Generates new password reset token */ public function generatePasswordResetToken() { $security = new Security(); $this->password_reset_token = $security->generateRandomKey() . '_' . time(); }