I want to create exact 5 random characters string with least possibility of getting duplicated. What would be the best way to do it? Thanks.
I want to create exact 5 random characters string with least possibility of getting
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Would be my best guess–Unless you’re looking for special characters, too:
Example
And, for one based on the clock (fewer collisions since it’s incremental):
Note: incremental means easier to guess; If you’re using this as a salt or a verification token, don’t. A salt (now) of “WCWyb” means 5 seconds from now it’s “WCWyg”)