Closed jproig closed 4 years ago
This is how I tested it: https://play.golang.org/p/5aYxVctNs3w
Since int
is used inside, which is 32 bit signed integer and maximum is 2147483647
, and also because of clamping which you noticed OTP more than 9 digit is not possible.
I am closing this issue
Hi, I tried to generate and OTP fo 10 digits (I understand that OTPs of more thatn 6-8 digits are really unusual) but the generateOTP() is capping it to 9 digits. I think the problem is since line 51 (otp.go) clamps to 31b and 1<<31 < 1e10, this can't be more than 9. I am ok with 9 being a limit, but that should probably be clearly documented and/or asserted somewhere. Thanks