Skip to content

Instantly share code, notes, and snippets.

@yetanotherchris
Last active December 12, 2015 08:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yetanotherchris/4746641 to your computer and use it in GitHub Desktop.
Save yetanotherchris/4746641 to your computer and use it in GitHub Desktop.
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