Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Unique identifiers: url hash
public static string HostnameHash(Uri uri)
{
// e.g. Uri uri = new Uri("http://www.yetanotherchris.info/csharp/example");
// gives eaafc653
int hashcode = uri.GetHashCode();
Console.Write(string.Format("{0:X}", hashcode).ToLower());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment