public function generateSecret() { $secret = ""; for ($i = 1; $i <= self::$SECRET_LENGTH; $i++) { $c = rand(0, 255); $secret .= pack("c", $c); } $base32 = new FixedBitNotation(5, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567', true, true); return $base32->encode($secret); }
/** * @return string */ public function generateSecret() { $secret = ""; for ($i = 1; $i <= $this->secretLength; $i++) { $c = rand(0, 255); $secret .= pack("c", $c); } $base32 = new FixedBitNotation(5, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567', TRUE, TRUE); return $base32->encode($secret); }