Skip to content

Instantly share code, notes, and snippets.

@feanz
Created September 10, 2013 22:13
Show Gist options
  • Save feanz/6516510 to your computer and use it in GitHub Desktop.
Save feanz/6516510 to your computer and use it in GitHub Desktop.
Guid Hash
public static Guid Hash(params object[] args)
{
var composite = "";
foreach (var a in args)
{
composite += a.ToString();
}
Guid result;
using(var md5 = new MD5CryptoServiceProvider())
{
var bytes = System.Text.Encoding.UTF8.GetBytes(composite);
result = new Guid(md5.ComputeHash(bytes));
}
return result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment