mercredi 14 décembre 2016

Bitwise in a client - server scenario miscalculating

I have been tasked with creating a server for a client. I have all of the clients' code, so using it, I must create a server.

The client has a particular piece of code in a function called readInt(num1); return num1 << 24 | num1 << 16 | num1 << 8 | num1, and I can't haggle with it.

I tried what comes to mind first - just reverse it, right? If the int needs to be 3, do 3 << 24, but no yield.

My mind doesn't work well mathematically, and I'm not a good problem solver, so if I want, say 3 on the server to read as 3 on the client, what formula would I use server-side to achieve this?

The client is in Adobe ActionScript 3, and the server in Python 2.7.12.

Aucun commentaire:

Enregistrer un commentaire