Need MD5 hash for an in memory System.Drawing.Image
相关问题
- Views base64 encoded blob in HTML with PHP
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- How to get the background from multiple images by
- Generic Generics in Managed C++
A simple sample, based on the sample in MSDN; note that this hash is dependent on the internal representation of the image and will not correspond to the hash created from a file.
To be able to use the
MD5
class you need to add a reference toSystem.Security
.Depending on what you are going to use the hash for you should consider the fact that MD5 is no longer state of the art and that there are better hash functions available if you need a strong hash.
Thanks to the other fellows who answered. Here's what I ended up doing:
Here is a basic snippet. See also @JaredReisinger 's comment for some questions.