我正在构建一个 OTP 并实现了 ROTP gem。然而,ROTP 的行为并不是我所期望的。
例如,当请求一个间隔为 30 秒的 ROTP 时
at 15:00:14, this will return you an OTP say 212321
at 15:00:30, however, this will return you a new OTP say 312932
注意它没有达到 30 秒的到期时间,但已经返回给你一个新的 otp
我对基于时间的 OTP 的预期行为是
at 15:00:14, this will return you an OTP say 212321
at 15:00:30, will still return 212321
at 15:00:44, will return a new OTP because it has reached the 30 secs of expiry interval
如何实现基于时间的 OTP 的预期行为?