Recently a company and to carry out docking system, the other using C # gives such an encryption function:
1 |
public static string (string str) |
First byte string into a form, then its MD5 encryption, and finally BASE64 encryption. In the first note in Chinese Python2 code is very easy to go wrong, it first becomes unicode string form, and then were subjected to encode:
Large column in python md5 and base64 encryption ">1 |
Import hashlib |
From the process point of view algorithm it should be the same, but I do not know why we found base64 code but still can not be verified. After the last resort built .net C # found in the development environment is a 16-bit md5 encryption, so do not use 32-bit ciphertext generating md5.hexdigest in python.