how to generate a random string, and specify the length you want, or better generate unique string on specification you want
- by HCP
There is a library to generate Random numbers, so why in't there a library for generation random strings ?
In other words how to generate a random string, and specify the length you want, or better generate unique string on specification you want i.e
specify the length, a unique string within my application is enough for me.
I know I can create a Guid (globally unique identifier) but those are quite long, longer they need to be.
int length = 8;
string s = RandomString.NextRandomString(length)
uniquestringCollection = new UniquestringsCollection(length)
string s2 = uniquestringCollection.GetNext();