From 8ea8aa754380f5df6c1a152e42943285e4462ce8 Mon Sep 17 00:00:00 2001 From: CarlosHe Date: Wed, 22 Jun 2022 01:57:04 -0300 Subject: [PATCH] set otp length --- src/contracts/OTP.Contract.Core.Calculator.pas | 2 +- src/cores/OTP.Core.Calculator.pas | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/contracts/OTP.Contract.Core.Calculator.pas b/src/contracts/OTP.Contract.Core.Calculator.pas index afc1cff..1e6281d 100644 --- a/src/contracts/OTP.Contract.Core.Calculator.pas +++ b/src/contracts/OTP.Contract.Core.Calculator.pas @@ -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; diff --git a/src/cores/OTP.Core.Calculator.pas b/src/cores/OTP.Core.Calculator.pas index bdce37b..792eb44 100644 --- a/src/cores/OTP.Core.Calculator.pas +++ b/src/cores/OTP.Core.Calculator.pas @@ -13,7 +13,7 @@ TOTPCalculator = class(TInterfacedObject, IOTPCalculator) FSecret: string; FCounter: Int64; FKeyRegeneration: Integer; - FLength: Word; + FLength: Byte; protected { protected declarations } constructor Create; @@ -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; @@ -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;