public static void Write(EncryptedInt32 value, byte[] data, int offset) { uint enc = Encrypt(value.Value, value.Shift, value.Adjust); byte chk = CalculateChecksum(enc); BitConverter.GetBytes(enc).CopyTo(data, offset + 0); BitConverter.GetBytes(value.Adjust).CopyTo(data, offset + 4); data[offset + 6] = value.Shift; data[offset + 7] = chk; }
public static void Write(uint value, byte[] data, int offset) { var fake = new EncryptedInt32(value); Write(fake, data, offset); }