Skip to content

Commit

Permalink
variable name changed
Browse files Browse the repository at this point in the history
  • Loading branch information
ogulcanturan committed Jun 20, 2024
1 parent 517c445 commit 0bf9da2
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions samples/Otp.Console/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public static void GenerateTotpCode()
var secretKey = _totp.GenerateSecretKey();
var code = _totp.GenerateCode(secretKey);
_totpGeneratedSecretKeys.Add(_totpGeneratedSecretKeys.Count, secretKey);
string uri = _totp.GetUri("John", secretKey);
var uri = _totp.GetUri("John", secretKey);

var otpValidationResult = _totp.ValidateCode(code, secretKey);

Expand Down Expand Up @@ -121,7 +121,7 @@ public static void ValidateTotpCode()

System.Console.WriteLine("Enter the code:");

string code = System.Console.ReadLine();
var code = System.Console.ReadLine();

var totpValidationResult = _totp.ValidateCode(code, secretKey);

Expand All @@ -134,7 +134,7 @@ public static void GenerateHotpCode()
var secretKey = _hotp.GenerateSecretKey();
var code = _hotp.GenerateCode(secretKey);
_hotpGeneratedSecretKeys.Add(_hotpGeneratedSecretKeys.Count, (secretKey, 0));
string uri = _hotp.GetUri("John", secretKey);
var uri = _hotp.GetUri("John", secretKey);

var otpValidationResult = _hotp.ValidateCode(code, secretKey, 0);

Expand Down Expand Up @@ -198,23 +198,23 @@ public static void ValidateHotpCode()

System.Console.WriteLine("Enter the code:");

string code = System.Console.ReadLine();
var code = System.Console.ReadLine();

var totpValidationResult = _hotp.ValidateCode(code, secretKey, counter);
var hotpValidationResult = _hotp.ValidateCode(code, secretKey, counter);

System.Console.WriteLine($"IsCodeValid: {totpValidationResult.IsValid}\n" +
$"Tolerance: {totpValidationResult.Tolerance}\n" +
System.Console.WriteLine($"IsCodeValid: {hotpValidationResult.IsValid}\n" +
$"Tolerance: {hotpValidationResult.Tolerance}\n" +
$"CurrenctCounter: {counter}\n" +
$"NextCounter: {++counter}");
}

// Package: QRCoder
private static void GenerateQrCode(string uri, bool saveAsPng)
{
QRCodeGenerator qrGenerator = new QRCodeGenerator();
var qrGenerator = new QRCodeGenerator();
QRCodeData qrCodeData = qrGenerator.CreateQrCode(uri, QRCodeGenerator.ECCLevel.M);

AsciiQRCode asciiQrCode = new AsciiQRCode(qrCodeData);
var asciiQrCode = new AsciiQRCode(qrCodeData);
var qrCodeString = asciiQrCode.GetGraphic(1);

System.Console.WriteLine(qrCodeString);
Expand All @@ -225,7 +225,7 @@ private static void GenerateQrCode(string uri, bool saveAsPng)
byte[] qrCodeBytes = sd.GetGraphic(20);

Bitmap qrCodeImage;
using (MemoryStream stream = new MemoryStream(qrCodeBytes))
using (var stream = new MemoryStream(qrCodeBytes))
{
qrCodeImage = new Bitmap(stream);
}
Expand Down

0 comments on commit 0bf9da2

Please sign in to comment.