Skip to content

Commit e7db3cd

Browse files
committed
refactor: 更新接口
1 parent a130a33 commit e7db3cd

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/BootstrapBlazor/Services/DefaultTotpService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class DefaultTotpService : ITotpService
99
{
1010
public TotpInstanceBase Instance { get; } = new DefaultTotpInstance();
1111

12-
public string Compute(string secretKey, DateTime? timestamp = null) => "123456";
12+
public string Compute(string secretKey, int step = 6, OtpHashMode mode = OtpHashMode.Sha1, int totpSize = 6, DateTime? timestamp = null) => "123456";
1313

1414
public string GenerateOtpUri(OtpOptions? options = null) => "otpauth://totp/BootstrapBlazor?secret=OMM2LVLFX6QJHMYI&issuer=Simulator";
1515

src/BootstrapBlazor/Services/ITotpService.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,12 @@ public interface ITotpService
2121
/// Computes the Time-based One-Time Password (TOTP) for the given secret key and timestamp.
2222
/// </summary>
2323
/// <param name="secretKey"></param>
24+
/// <param name="step"></param>
25+
/// <param name="mode"></param>
26+
/// <param name="totpSize"></param>
2427
/// <param name="timestamp"></param>
2528
/// <returns></returns>
26-
string Compute(string secretKey, DateTime? timestamp = null);
29+
string Compute(string secretKey, int step = 6, OtpHashMode mode = OtpHashMode.Sha1, int totpSize = 6, DateTime? timestamp = null);
2730

2831
/// <summary>
2932
/// Computes the remaining seconds until the next TOTP expiration for the given secret key and timestamp.

0 commit comments

Comments
 (0)