Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use long for counter in OtpUri #61

Merged
merged 1 commit into from
Apr 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/Otp.NET/OtpUri.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public OtpUri(
OtpHashMode algorithm = OtpHashMode.Sha1,
int digits = 6,
int period = 30,
int counter = 0)
long counter = 0)
{
_ = secret ?? throw new ArgumentNullException(nameof(secret));
_ = user ?? throw new ArgumentNullException(nameof(user));
Expand Down Expand Up @@ -56,7 +56,7 @@ public OtpUri(
OtpHashMode algorithm = OtpHashMode.Sha1,
int digits = 6,
int period = 30,
int counter = 0)
long counter = 0)
: this(schema, Base32Encoding.ToString(secret), user, issuer,
algorithm, digits, period, counter)
{ }
Expand Down Expand Up @@ -102,7 +102,7 @@ public OtpUri(
/// <summary>
/// Initial counter value for HOTP. This is ignored when using TOTP.
/// </summary>
public int Counter { get; private set; }
public long Counter { get; private set; }

/// <summary>
/// Generates a Uri according to the parameters
Expand Down