code: function parseRIFF(string) {
      var offset = 0;
      var chunks = {};
  
      while (offset < string.length) {
        var id = string.substr(offset, 4);
        var len = parseInt(string.substr(offset + 4, 4).split('').map(function (i) {
          var unpadded = i.charCodeAt(0).toString(2);
          return (new Array(8 - unpadded.length + 1)).join('0') + unpadded
        }).join(''), 2);
        var data = string.substr(offset + 4 + 4, len);
        offset += 4 + 4 + len;
        chunks[id] = chunks[id] || [];
  
        if (id == 'RIFF' || id == 'LIST') {
          chunks[id].push(parseRIFF(data));
        } else {
          chunks[id].push(data);
        }
      }
      return chunks;
    }
docs: i think i'm going off on a riff by pretending this is some known idiom which i'm making a casual and brilliant pun about, but since i can't find anything on google which conforms to this idiomatic usage, I'm assuming this is just a consequence of some psychotic break which makes me make up puns. well, enough riff-raff (aha a rescue of sorts), this function was ripped wholesale from weppy