feanz
9/10/2013 - 10:13 PM

Guid Hash

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;
}