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