MD5 hash discrepancy between Python and PHP?
PHP and python use different base64 flavors:
The problem seems to be that your base-64-encoding the file data, changing the structure of the binary data, in php I belive that it does not base_64 encode the file.
Give this a go:
def md5_file(filename): //MD5 Object crc = hashlib.md5() //File Pointer Object fp = open(filename, 'rb') //Loop the File to update the hash checksum for i in fp: crc.update(i) //Close the resource fp.close() //Return the hash return crc.hexdigest()
and within PHP use md5_file
and see if that works accordingly.
python taken from: http://www.php2python.com/wiki/function.md5-file/