Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Convert a GUID to a smaller (unique) GUID
public static string GuidToShortGuid(Guid gooid)
string encoded = Convert.ToBase64String(gooid.ToByteArray());
encoded = encoded.Replace("/", "_").Replace("+", "-");
return encoded.Substring(0, 22);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment