Random::otp returns string instead of int #10
Answered
by
valorin
binaryfire
asked this question in
Q&A
-
Hey @valorin, Is there a reason why |
Beta Was this translation helpful? Give feedback.
Answered by
valorin
Jan 2, 2024
Replies: 1 comment
-
It needs to be a string so it keeps the leading zeros. An integer won't keep them, which is the whole point of the function. Otherwise, you'll end up with less than 6 digits or be forced to start at something like Good question though - I should make it more obvious. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
binaryfire
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It needs to be a string so it keeps the leading zeros. An integer won't keep them, which is the whole point of the function.
Otherwise, you'll end up with less than 6 digits or be forced to start at something like
100000
instead of000000
.Good question though - I should make it more obvious.