Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Very big value for CRC32
Message
From
12/08/2011 04:50:55
 
 
To
11/08/2011 15:57:30
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:
01520761
Message ID:
01520807
Views:
49
>Is this an acceptable value for a CRC32:
>
>3989233970
>
>This value goes higher than the maximum allowed for an integer. So, I thought I would verify first if this is a value we could receive from a CRC32 before adding support for a BigInt in my application.

All that matters is the 32 bit pattern held by the integer. It does not matter whether you use Int32 of UInt32 to hold the value - bitwise operations never cause an overflow.
As long as the types you use for the comparison are the same (i.e. both Int32 or both UInt32) it will work. Actually, in VB.NET I think you can do bitwise operations on a mix of types. e.g:
Dim i As Int32 = 16777215
Dim u As UInt32 = i
Dim Match As Boolean = (i Xor u) = 0
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform