Skip to content

Instantly share code, notes, and snippets.

@yetanotherchris
Created February 9, 2013 19:19
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/4746664 to your computer and use it in GitHub Desktop.
Save yetanotherchris/4746664 to your computer and use it in GitHub Desktop.
Unique identifiers: MD5
public static string RandomMD5()
{
byte[] buffer = GetRandom(16);
MD5 md5 = System.Security.Cryptography.MD5.Create();
byte[] output = md5.ComputeHash(buffer);
StringBuilder builder = new StringBuilder();
for (int i = 0; i < output.Length; i++)
builder.AppendFormat("{0:x2}", output[i]);
return builder.ToString();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment