title: convert JavaScript byte array to Python datatype
body: <p>I have an application/service with which I'm attempting to interface. The service sends JavaScript byte arrays raw over to the native JavaScript client. From what I can tell, the client basically shoves the series of binary bytes into a variable. For clarity, the following is how the native JavaScript client handles this data:</p>
  
  <pre><code>t.prototype.responseToMsg = function(t) {
    var i, r, u;
    return n.Msg.isMsg(t) ? t : (i = "",
    true ? true ? (r = new Uint8Array(t),
    i = this.decode(r)) : (u = this.parseStr(t),
    i = this.decode(u)) : i = t,
    angular.fromJson(i))
  }
  </code></pre>
  
  <p>JavaScript is syntactically familiar but otherwise not something I use. This code is somewhat obfuscated / minified.</p>
  
  <p>So my client is written in Python, and I have limited modules available in my environment. I can't use something like a Python module to evaluate it natively in JavaScript, nor do I want to make external calls to something like <code>node.js</code> - I think these probably introduce additional problems with implementation.</p>
  
  <p>What would be great would be to someway convert the byte array to a dictionary or some other format in Python. If I can get there, I can handle the JSON deserialization later.</p>
  
  <p>Is there a way to parse or convert this raw data to a usable Python datatype?</p>