Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
CRC32 returns negative on big files
Message
From
01/08/2011 08:46:38
 
 
To
01/08/2011 08:16:07
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:
01519800
Views:
18
>>Yes, it seems vb interpretes those as signed
>>
>>http://msdn.microsoft.com/en-us/library/s9cz43ek.aspx
>>
>>Append the type to the constant. U and I
>>
>>    Dim lnCRC32Result As UInteger = &HFFFFFFFFUI
>>
>
>Thanks, in regards to that issue, yes, it does allows to define UInteger with HEX values.


Right. Concerning the negative/positive matter. It's the structure of the bits that matters, not whether you look at it as signed or unsigned

In Foxpro
	xx = repl(chr(0xff), 4)
	crc32 = sys(2007, m.xx,-1,1)
	
	?crc32  && 4294967295
	?vartype(crc32)  && C
	
	?int(val(crc32))  && 4294967295
	
	&& Force a signed 32 bit integer
	?bitor(int(val(crc32)), 0) && -1
Gregory
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform