Performing CRC32 on big files

Just starting out? Need help? Post your questions and find answers here.
Justin
Addict
Addict
Posts: 958
Joined: Sat Apr 26, 2003 2:49 pm

Performing CRC32 on big files

Post by Justin »

How can i perform a CRC32 on a file that is bigger than my aviable free disk space? , i can't load it into a buffer. It has to be some way because i have a program that does it, any idea?.
dmoc
Enthusiast
Enthusiast
Posts: 739
Joined: Sat Apr 26, 2003 12:40 am

Post by dmoc »

I hope you mean "memory"? If so, from memory (mine, not the computers), I think determining the crc involves serial processing the data from start to end, ie, at no time refering to data already processed. Therefore I think you need to check how to combine crc from successive blocks of data. Sorry I don't have time to search the web for more info... but you could :wink:
freak
PureBasic Team
PureBasic Team
Posts: 5948
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post by freak »

You should take a look at Rings's FastFile Lib, it has a command calculating
a CRC32 of a file on disk.

http://www.reelmediaproductions.com/pb/ ... stFile.zip

look at the FastFileCRC32Test.pb file.

Timo
quidquid Latine dictum sit altum videtur
Justin
Addict
Addict
Posts: 958
Joined: Sat Apr 26, 2003 2:49 pm

Post by Justin »

The FASTFILECRC32() does it :) , i'll make some tests but this appears to be an excellent lib.

Thanks :D
GPI
PureBasic Expert
PureBasic Expert
Posts: 1394
Joined: Fri Apr 25, 2003 6:41 pm

Re: Performing CRC32 on big files

Post by GPI »

Justin wrote:How can i perform a CRC32 on a file that is bigger than my aviable free disk space? , i can't load it into a buffer. It has to be some way because i have a program that does it, any idea?.
Make for, example, for every 64Kb a own CRC.
Justin
Addict
Addict
Posts: 958
Joined: Sat Apr 26, 2003 2:49 pm

Post by Justin »

And how do you get the CRC of the whole file from that? , anyways FASTFILECRC32() does it, it can't be easier.
User avatar
Rings
Moderator
Moderator
Posts: 1435
Joined: Sat Apr 26, 2003 1:11 am

Post by Rings »

Justin wrote:And how do you get the CRC of the whole file from that? , anyways FASTFILECRC32() does it, it can't be easier.
but remember that calculating a crc from a 640MB ISO-file can take a lot of seconds....
SPAMINATOR NR.1
Justin
Addict
Addict
Posts: 958
Joined: Sat Apr 26, 2003 2:49 pm

Post by Justin »

Yes, i made a crc of a cd and took some time, but this is normal. Do you plan to make it linux compatible? , also working with handles to have unlimited files would be great.

hfile1=FastOpenFile(Filename.s)
hfile2=FastOpenFile(Filename.s)
.
.
FastReadData(hfile1,Offset.l,Length.l,AdressofDestination)

etc.
User avatar
Rings
Moderator
Moderator
Posts: 1435
Joined: Sat Apr 26, 2003 1:11 am

Post by Rings »

Justin wrote:Yes, i made a crc of a cd and took some time, but this is normal. Do you plan to make it linux compatible? , also working with handles to have unlimited files would be great.

hfile1=FastOpenFile(Filename.s)
hfile2=FastOpenFile(Filename.s)
.
.
FastReadData(hfile1,Offset.l,Length.l,AdressofDestination)

etc.
thanx for your interrest in this library.
Yes , multiply files (With Filepointer) are in progress.
No for the linux version, coz i'm not familar enough (or better say Not ) with the linux api.
SPAMINATOR NR.1
Post Reply