>>That seems odd (although I agree it is true).
>>The equivalent in C# is fine ( UInt32 lcCRC33Result = 0xFFFFFFFF) and you can achieve the requred result in VB using ' Dim lnCRC32Result = UInt32.MaxValue'
>>
>>But VB.NET isn't my first language so there may be some VB related quirk I'm not aware of. IAC, AFAICS, we've established that an unsigned int isn't a good choice since it offers no benefits and may, in some circumstances, be less useful in that (a) it's not CLS compliant and (b) it may not be storable in some databases.
>
>Thanks, so basically, the current formula is OK and can return negative values, which would then be normal.
>
>So, this whole thread that you exchanged with Gregory was about the possibility to always return a positive value, which would then be not polynomal PKZip CRC32 compliant. Is that it?
Michel,
Both are 'polynomal PKZip CRC32 compliant'
Whether you return an Integer (which can be < 0) or a UInteger (always >= 0) , does not matter. It's the bit pattern that matters, ie
0xFFFFFFFF
is -1 if it is an Integer
is 4,294,967,295 if it is a UInteger
So,
dim xx as Integer = &HFFFFFFFF ' -1
or
dim xx as UInteger = &HFFFFFFFFUI ' 4,294,967,295
Both bit structures are equal
Gregory