When using python for MD5 encryption, the string needs to be encoded.
The code is as follows:
def md5(str):
str = str.encode('utf-8')
import hashlib
m = hashlib.md5()
m.update(str)
return m.hexdigest()
MD5 encryption for Chinese in js is:
string= MD5(string)
But the results are different. For example, the result of string= 'I am a test string' in python is: fd962c144eae1ac6912480fd4abd2d87
And the result in js is: 4fa9edf38bb340c273dc4c969ca680bb, so I want to know how these two languages compare to Chinese Can MD5 encryption be used to make the result consistent?
AES encryption can be found randomly, you can refer to it
It may be an encoding format problem. Check the encoding format of the characters received by your js