The hashpw function tries to write an MD5 sum as hexadecimal, but leading zeros are not preserved, so a byte 0d is written as d.
More generally, this is a terrible hash function. We should replace it with something like bcrypt and use proper salting.