Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
CRC32 returns negative on big files
Message
De
01/08/2011 08:46:38
 
 
À
01/08/2011 08:16:07
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01519635
Message ID:
01519800
Vues:
19
>>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform