Skip to content

Commit

Permalink
set otp length
Browse files Browse the repository at this point in the history
  • Loading branch information
CarlosHe committed Jun 22, 2022
1 parent 79e669a commit 8ea8aa7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/contracts/OTP.Contract.Core.Calculator.pas
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ interface
function SetKeyRegeneration(const AKeyRegeneration: Integer): IOTPCalculator;
function SetSecret(const ASecret: string): IOTPCalculator;
function SetCounter(const ACounter: Int64): IOTPCalculator;
function SetLength(const ALength: Word): IOTPCalculator;
function SetLength(const ALength: Byte): IOTPCalculator;
function Calculate: UInt32;
end;

Expand Down
6 changes: 3 additions & 3 deletions src/cores/OTP.Core.Calculator.pas
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ TOTPCalculator = class(TInterfacedObject, IOTPCalculator)
FSecret: string;
FCounter: Int64;
FKeyRegeneration: Integer;
FLength: Word;
FLength: Byte;
protected
{ protected declarations }
constructor Create;
Expand All @@ -22,7 +22,7 @@ TOTPCalculator = class(TInterfacedObject, IOTPCalculator)
function SetKeyRegeneration(const AKeyRegeneration: Integer): IOTPCalculator;
function SetSecret(const ASecret: string): IOTPCalculator;
function SetCounter(const ACounter: Int64): IOTPCalculator;
function SetLength(const ALength: Word): IOTPCalculator;
function SetLength(const ALength: Byte): IOTPCalculator;
function Calculate: UInt32;
class function New: IOTPCalculator;
end;
Expand Down Expand Up @@ -97,7 +97,7 @@ function TOTPCalculator.SetKeyRegeneration(const AKeyRegeneration: Integer): IOT
FKeyRegeneration := AKeyRegeneration;
end;

function TOTPCalculator.SetLength(const ALength: Word): IOTPCalculator;
function TOTPCalculator.SetLength(const ALength: Byte): IOTPCalculator;
begin
Result := Self;
FLength := ALength;
Expand Down

0 comments on commit 8ea8aa7

Please sign in to comment.