Re: Calculate sha1 hash of a binary file

2008-08-07 Thread Nikolaus Rath
LaundroMat [EMAIL PROTECTED] writes: Hi - I'm trying to calculate unique hash values for binary files, independent of their location and filename, and I was wondering whether I'm going in the right direction. Basically, the hash values are calculated thusly: f = open('binaryfile.bin')

Re: Calculate sha1 hash of a binary file

2008-08-07 Thread LaundroMat
Thanks all! -- http://mail.python.org/mailman/listinfo/python-list

Re: Calculate sha1 hash of a binary file

2008-08-07 Thread LaundroMat
I did some testing, and calculating the hash value of a 1Gb file does take some time using this method. Would it be wise to calculate the hash value based on say for instance the first Mb? Is there a much larger chance of collusion this way (I suppose not). If it's helpful, the files would

Re: Calculate sha1 hash of a binary file

2008-08-07 Thread Paul Rubin
LaundroMat [EMAIL PROTECTED] writes: Would it be wise to calculate the hash value based on say for instance the first Mb? Is there a much larger chance of collusion this way (I suppose not). If it's helpful, the files would primarily be media (video) files. The usual purpose of using this

Re: Calculate sha1 hash of a binary file

2008-08-07 Thread LaundroMat
On Aug 7, 2:22 pm, Paul Rubin http://[EMAIL PROTECTED] wrote: LaundroMat [EMAIL PROTECTED] writes: Would it be wise to calculate the hash value based on say for instance the first Mb? Is there a much larger chance of collusion this way (I suppose not). If it's helpful, the files would

Calculate sha1 hash of a binary file

2008-08-06 Thread LaundroMat
Hi - I'm trying to calculate unique hash values for binary files, independent of their location and filename, and I was wondering whether I'm going in the right direction. Basically, the hash values are calculated thusly: f = open('binaryfile.bin') import hashlib h = hashlib.sha1()

Re: Calculate sha1 hash of a binary file

2008-08-06 Thread Tim Golden
LaundroMat wrote: Hi - I'm trying to calculate unique hash values for binary files, independent of their location and filename, and I was wondering whether I'm going in the right direction. Basically, the hash values are calculated thusly: f = open('binaryfile.bin') import hashlib h =