Hello, I am amazed that the md5 of a file given by python in windows is
different than that of linux. Consider the following code:
import hashlib
def md5_for_file(f, block_size=2**20):
md5 = hashlib.md5()
while True:
data = f.read(block_size)
if not data:
break
I have been writing a c++ program that is supposed to call the python
function. The code is a snippet from python.org itself.
#include
#include
#include
int main()
{
Py_SetProgramName("Learning");
Py_Initialize();
PyRun_SimpleString("import hashlib\nprint hashlib.md5