I’d like to generate random unique strings like the ones being generated by MSDN library.(Error Object), for example. A string like ‘t9zk6eay’ should be generated.
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.
Using Guid would be a pretty good way, but to get something looking like your example, you probably want to convert it to a Base64 string:
I get rid of ‘=’ and ‘+’ to get a little closer to your example, otherwise you get ‘==’ at the end of your string and a ‘+’ in the middle. Here’s an example output string:
‘OZVV5TpP4U6wJthaCORZEQ’