Skip to content

Random::otp returns string instead of int #10

Answered by valorin
binaryfire asked this question in Q&A
Discussion options

You must be logged in to vote

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 of 000000.

Good question though - I should make it more obvious.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by binaryfire
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants