Get a Cyclic Redundancy Check of a value

private string GetCrc(string Value)
{
 byte[] TextBytes = System.Text.Encoding.UTF8.GetBytes(Value);
 System.Security.Cryptography.MD5Cng Md5 = new System.Security.Cryptography.MD5Cng();
 Md5.ComputeHash(TextBytes);
 System.Text.StringBuilder StringBuilderBuffer = new System.Text.StringBuilder();
 foreach (byte HashByte in Md5.Hash) {
  StringBuilderBuffer.Append(HashByte.ToString("X"));
 }
 return StringBuilderBuffer.ToString;
}

No comments:

Post a Comment