V
vector
I've got an application that generates GUIDs. A lot of GUIDs. Lots
of GUIDs that end up in files on disk, taking up space. I'd like to
continue using the Guid.NewGuid() function as my unique tag generator,
but I'd also like to compress them to base 36 strings, which should
retain their uniqueness but save me disk space. I've looked at
various base conversion functions, and haven't found a suitable one.
Further, I don't need an AnyBase converter. I need a very specific
thing: a base-16 string to base-36 string converter. Anything
additional would be a waste. Can somebody help me fill in the blanks
below?
static string MakeGuid36()
{
//make a new guid
Guid g = Guid.NewGuid();
//convert the guid to a base-16 string
string strGuid = g.ToString().Replace("-", "");
//convert the base-16 string to a base-36 string
??
//return the result
return strGuid;
}
of GUIDs that end up in files on disk, taking up space. I'd like to
continue using the Guid.NewGuid() function as my unique tag generator,
but I'd also like to compress them to base 36 strings, which should
retain their uniqueness but save me disk space. I've looked at
various base conversion functions, and haven't found a suitable one.
Further, I don't need an AnyBase converter. I need a very specific
thing: a base-16 string to base-36 string converter. Anything
additional would be a waste. Can somebody help me fill in the blanks
below?
static string MakeGuid36()
{
//make a new guid
Guid g = Guid.NewGuid();
//convert the guid to a base-16 string
string strGuid = g.ToString().Replace("-", "");
//convert the base-16 string to a base-36 string
??
//return the result
return strGuid;
}