Re: Md5 is different in Windows and Linux

2015-03-02 Thread Thomas Rachel
Am 02.03.2015 20:14 schrieb sohcahto...@gmail.com: On Monday, March 2, 2015 at 12:43:59 AM UTC-8, Sarvagya Pant wrote: f = open("somefile.txt") This one is the problem. Under Windows, you have to open the file in binary to avoid that something "bad" happens with it. So just do f = open("

Re: Md5 is different in Windows and Linux

2015-03-02 Thread sohcahtoa82
On Monday, March 2, 2015 at 12:43:59 AM UTC-8, Sarvagya Pant wrote: > 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() >     w

Re: Md5 is different in Windows and Linux

2015-03-02 Thread Gene Heskett
On Monday 02 March 2015 01:19:46 Sarvagya Pant wrote: > 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: >

Re: Md5 is different in Windows and Linux

2015-03-02 Thread Denis McMahon
On Mon, 02 Mar 2015 12:04:46 +0545, Sarvagya Pant wrote: > When I run the program I get the checksum value: > 2f9cc8da53ee89762a34702f745d2956 > > But on this site http://onlinemd5.com/ and on linux it has value > E10D4E3847713472F51BC606852712F1. > > Why is there difference in value of Checksum

Re: Md5 is different in Windows and Linux

2015-03-02 Thread Peter Otten
Sarvagya Pant wrote: > 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)

Re: Md5 is different in Windows and Linux

2015-03-02 Thread Tim Golden
On 02/03/2015 06:19, Sarvagya Pant wrote: > 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 =

Md5 is different in Windows and Linux

2015-03-02 Thread Sarvagya Pant
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