How i should pass the value of string x (\0x02...) to the hashlib.md5 function and get the same output as result0 (05db8f903dc9adc5874eb2cab3aa725b) ?
Note: b'' is a prefix, that causes the following string to be interpreted as a bytes-type object. The bytes function takes a string and returns a bytes object.
This is my code:
import hashlib
result0 = hashlib.md5(b'\x02\x6d\x79\x5f\x70\x61\x73\x73\xe2\x5b\xc4\x1c\x40\x8a\x54\x84\x3e\xbd\xee\xab\xdc\x69\x90\xc0')
print(result0.hexdigest())
x= '\x02\x6d\x79\x5f\x70\x61\x73\x73\xe2\x5b\xc4\x1c\x40\x8a\x54\x84\x3e\xbd\xee\xab\xdc\x69\x90\xc0'
yourstring = x.encode('ascii', 'ignore')
var = bytes(yourstring)
result1 = hashlib.md5(var)
print(result1.hexdigest())