Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
CRC32 returns negative on big files
Message
From
30/07/2011 13:48:16
 
 
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01519635
Message ID:
01519697
Views:
37
>From the algorithm it looks as if you could easily end up with a negative result regardless of file size.
>I don't know the inner workings of the calculation but, since it is essentially a bitwise operation, why do you thing negative int representations are invalid (you don't show any usage of the nCRC32 return value) ?

I saw it like that since the last two years. I always assumed it could be ok to have negative values. But, yesterday, we compared a related class in Visual FoxPro for CRC32 to mine and we did not obtain the same results on big files. We were obtaining the same values for small files but not on big ones. So, I assumed mine was wrong. So, you're saying that it could be normal to obtain a negative value for a CRC32?

>Also, for larger files why not use a larger buffer ?

I tried it with 8192 but the result is as fast with 1024.

>See you're still not using OPTION STRICT :-}

Well, I put it on and ended up with a bunch of errors where I would no longer be able to do things like:
Private cName As String = ""
cName = Trim(toRow("Table"))
As, it would give errors like:

"Option Strict On disallows implicit conversions from 'Object' to 'String'."
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform