You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have small question. Because the return type is int, the leading 0's are being dropped. This is being an issue for in the long run as the otp that is being shown is only 5 digits.
Now, can the return type be an String so that the user does not worry about the leading 0's. Personally, we had to waste a lot of time only to come to this conculsion.
The text was updated successfully, but these errors were encountered:
java-otp deliberately avoids making any decisions about the presentation of one-time passwords. This is, in large part, to allow callers to support locales that don't use Arabic numerals (0-9). One consequence is that callers will need to format numbers to account for leading zeroes.
We can consider expanding documentation, FAQs, and examples, but I don't think returning one-time passwords as Strings is the right way to go.
I completely understand your point on returning an integer. It makes sense.
But why don't adding just an helper function generateOneTimePasswordString which would be embedded in the class and do the conversion, for the ones that want to use it?
I have small question. Because the return type is int, the leading 0's are being dropped. This is being an issue for in the long run as the otp that is being shown is only 5 digits.
Now, can the return type be an String so that the user does not worry about the leading 0's. Personally, we had to waste a lot of time only to come to this conculsion.
The text was updated successfully, but these errors were encountered: