Skip to content

Instantly share code, notes, and snippets.

@wsky
Created August 30, 2012 01:47
Show Gist options
  • Save wsky/3521554 to your computer and use it in GitHub Desktop.
Save wsky/3521554 to your computer and use it in GitHub Desktop.
checksum MD5
using (var md5 = new MD5CryptoServiceProvider())
{
var retVal = md5.ComputeHash(file);
var sb = new StringBuilder();
for (int i = 0; i < retVal.Length; i++)
sb.Append(retVal[i].ToString("x2"));
return Json(sb.ToString());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment