Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sys(2007) in .net
Message
De
02/03/2005 11:39:56
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
02/03/2005 09:37:22
Information générale
Forum:
Visual FoxPro
Catégorie:
Visual FoxPro et .NET
Divers
Thread ID:
00991929
Message ID:
00992041
Vues:
20
Its a long time I didn't do anything in C; what does the ^= operator do?

>Oscar,
>
>Here is C# implementation of SYS( 2007) function:
>
public static ushort Sys2007( string strExpr)
>{
>	ushort result = 0xFFFF;
>	byte[] bytes = System.Text.Encoding.Default.GetBytes( strExpr);
>	for( int curPos = 0; curPos < bytes.Length; curPos++)
>	{
>		result = (ushort)(( result << 8) + (byte)( result >> 8));
>		result ^= bytes[curPos];
>		result ^= (ushort)(( result >> 4) & 0x0F);
>		result ^= (ushort)(((byte)( result & 0xFF) ^ (result << 7)) << 5);
>	}
>	return result;
>}
>
HTH
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform