• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1135
  • Last Modified:

Creating MD5 of XML Document


I have some code that produces an XML file.  Is it possible to create the MD5 hash value of it before I save it to disk.

I’d like to do this so that I can include the hash value within the XML document and / or call the file the MD5 value?

  • 2
1 Solution
RobOwner (Aidellio)Commented:
Sure that doesn't sound like an issue though you couldn't include it in the XML document or it would then be a different MD5 hash.  It's a pretty standard action to find the MD5 hash.  You can use the inbuilt MD5 class of the System.Security.Cryptography namespace.
Full example on it's use here:
RobOwner (Aidellio)Commented:
The MD5 ComputeHash() method acts on a file stream so you would need to save the XML doc first to then compute the MD5.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now