Closed bander-saeed94 closed 4 years ago
Hi, thanks for the suggestion. The minimum number of digits is set at 6, as this implementation follows the OTP specification—RFC4226—which states:
The HOTP value must be at least a 6-digit value.
I'm curious to see examples of 4-digit OTPs in use. If you want to use shorter passwords in your specific use case, the digit length is only a soft limit, so you can modify these lines: https://github.com/lachlanbell/SwiftOTP/blob/b45615e2dec54bde1d00f75f4e325685946ccf91/SwiftOTP/HOTP.swift#L67 https://github.com/lachlanbell/SwiftOTP/blob/b45615e2dec54bde1d00f75f4e325685946ccf91/SwiftOTP/TOTP.swift#L78
I notice it only accept range 6...8
I believe it should accept 4 since it is a common case