I need to generate a unique ID and was considering Guid.NewGuid to do this, which generates something of the form:
Guid.NewGuid
0fe66778-c4a8-4f93-9bda-36622
You can save space by using a base64 string instead:
var g = Guid.NewGuid(); var s = Convert.ToBase64String(g.ToByteArray()); Console.WriteLine(g); Console.WriteLine(s);
This will save you 12 characters (8 if you weren't using the hyphens).