Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jul 4th, 2009, 5:09 PM   #1
dezza
Newbie
 
dezza's Avatar
 
Join Date: Mar 2005
Location: Denmark
Posts: 23
Rep Power: 0 dezza is on a distinguished road
Send a message via ICQ to dezza Send a message via MSN to dezza
Calculate CRC32 checksums (like SFVs)

import binascii
def getCRC(filename):
     filedata = open(filename).read()
     return binascii.crc32(filedata)

So far i've got this and it returns something like:

-2087276233

Someone told me that I had to use struct.pack or struct.unpack to change it to hex values.

I am not sure which type to convert to and would like some explanation to understand fully instead of coding in blind.

The final result should show the same CRC32 value as if you packed the file in WinRAR, checked it with the numerous SFV-checkers or whatever.

A link just in case:
http://docs.python.org/library/struct.html

Thanks alot in advance!
__________________
Come in and have a talk!
#programmingforums @ Freenode


Folding@Home Stats
dezza is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Calculate using '-' HELP! DJ007 C 5 Jun 28th, 2009 5:43 AM
calculate distance using values in an array annie_singh Perl 3 Oct 4th, 2008 11:33 PM
VB.NET: Loops - calculate selected items jaybird01 Visual Basic .NET 7 Aug 14th, 2006 5:35 AM
need help on how to calculate between 2 input times. oslan C 18 Feb 14th, 2006 9:15 PM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 2:15 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC