Table of Contents
ToleranceSpan
Namespace: SimpleOTP
Represents a span of tolerance values used in OTP (One-Time Password) validation.
public struct ToleranceSpan
Inheritance Object → ValueType → ToleranceSpan
Implements IEquatable<ToleranceSpan>
Attributes IsReadOnlyAttribute
Properties
Default
Gets the default recommended ToleranceSpan value.
public static ToleranceSpan Default { get; }
Property Value
ToleranceSpan
The default ToleranceSpan value: 1 counter/period ahead and behind.
Behind
Gets the number of tolerance values behind the current value.
public int Behind { get; set; }
Property Value
Ahead
Gets the number of tolerance values ahead of the current value.
public int Ahead { get; set; }
Property Value
Constructors
ToleranceSpan(Int32, Int32)
Represents a span of tolerance values used in OTP (One-Time Password) validation.
ToleranceSpan(int behind, int ahead)
Parameters
behind Int32
The number of periods/counter values behind the current value.
ahead Int32
The number of periods/counter values ahead of the current value.
ToleranceSpan(Int32)
Initializes a new instance of the ToleranceSpan struct with the specified tolerance value. The ToleranceSpan.Behind and ToleranceSpan.Ahead properties will be set to the same value.
ToleranceSpan(int tolerance)
Parameters
tolerance Int32
The tolerance value to set for both ToleranceSpan.Behind and ToleranceSpan.Ahead.
Methods
Equals(ToleranceSpan)
bool Equals(ToleranceSpan other)
Parameters
other ToleranceSpan
Returns
Equals(Object)
bool Equals(object obj)
Parameters
obj Object
Returns
GetHashCode()
int GetHashCode()
Returns
ToString()
Returns the string representation of the ToleranceSpan struct.
string ToString()
Returns
String
The string representation of the ToleranceSpan struct.
©2025 Eugene Fox. Licensed under MIT license