For efficiency and obfuscation reasons, I am considering sending game result data in binary form. By doing so, I can reduce the amount of data sent by more than half, resulting in significant savings. Additionally, sending seemingly random bytes rather than distinguishable data adds a layer of obfuscation to the transmission.
Though it's not currently implemented and is just a prototype, my code snippet for converting integer values into binary strings is as follows:
String.fromCharCode.apply(null,somevar.toString(16).split(/(?=(?:..)+$)/).map(function(a) {return parseInt(a,16);}))
I have concerns regarding AJAX and handling binary data. I want to know what range of values would be safe to use in this context. Should I limit myself to 32-255, or play it even safer with 32-127? If I opt for 32-255, adjusting the base in the code snippet to 15 and adding 32 to all numbers may work for me.
However, my primary focus lies in understanding the character range limitations and exploring any potential cross-browser methods (particularly among Canvas-supporting browsers) for transferring binary data.