otp-generator
otp-generator copied to clipboard
Only Digits OTP Length
When I get a string of 6 digits and 1st character is 0, the actual number becomes 5 digits. This should not happen. Can we add a check that the 1st character is not 0 in case of only digits OTP?
0 at start is also valid OTP. Let me think if we can add option for same.
I started using this package specifically to avoid this issue... @kandarpkakkad or @Maheshkumar-Kakade - I dunno, has this issue been resolved? or is it still open?
It is not fixed yet. I will fix it by 20th Jan.
Like @Maheshkumar-Kakade pointed out, 0 is a valid start for an OTP. If your application removes the leading zeroes, you should be storing it as string and not a number. This should really be behind an optional configuration flag, and not enabled by default.