What c# equivalent encoding does Python's hash.digest() use ?
- by The_AlienCoder
I am trying to port a python program to c#. Here is the line that's supposed to be a walkthrough but is currently tormenting me:
hash = hashlib.md5(inputstring).digest()
After generating a similar MD5 hash in c# It is absolutely vital that I create a similar hash string as the original python program or my whole application will fail.
My confusion lies in which encoding to use when converting to string in c# i.e
?Encoding enc = new ?Encoding();
string Hash =enc.GetString(HashBytes); //HashBytes is my generated hash
Because I am unable to create two similar hashes when using Encoding.Default i.e
string Hash = Encoding.Default.GetString(HashBytes);
So I'm thinking knowing the deafult hash.digest() encoding for python would help