I recently needed to manipulate some binary data within JavaScript; my data stream was represented as a series of bytes, and I needed to extract floating point numbers from it. There were some existing solutions available on the Internet, but I thought that there was room for improvement. I wrote a generic solution (JS file here) to the problem, modeled on Python’s struct module.
If you have to solve similar problems, perhaps you will find this module useful. If you’re interested in how to get binary data into the JS environment, this guy has some ideas. Personally, I just Base64 encode everything.