Creating MD5 of XML Document

Hi,

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?

TIA
andyw27Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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:
http://msdn.microsoft.com/en-us/library/xa627k19.aspx
0
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.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C#

From novice to tech pro — start learning today.