Please can anyone point me in the right direction for compressing a (quite long) string of text in C# and then decompress it in JavaScript?
Basically I’m encoding an image to base64 and then sending it via a websocket to JavaScript, but want to be able to reduce the size of the string before sending it.
I know of ways it can be done from C# to C#, like using gzip or quicklz, but haven’t found anything for C# to JavaScript. Would appreciate any info you have. 🙂 Thanks.
Images are almost always compressed anyway, so I wouldn’t expect you to be able to get any benefit there. It strikes me that the main thing you could try to do is remove the “text” part here, avoiding converting to/from base64 in the first place.
I don’t have any experience with websockets myself, but I would investigate transferring binary data that way instead of text.