title: Uncompressing Gzip buffer in JavaScript
body: <p>I've got a data buffer compressed by the php function gzcompress and I need to uncompress it in js (nodejs).</p>
  
  <pre><code>gzcompress(serialize($slot[$i]['advanced_details']),8)
  </code></pre>
  
  <p>I've tried Class: zlib.Gunzip from <a href="https://nodejs.org/api/zlib.html#zlib_class_zlib_gunzip" rel="nofollow noreferrer">https://nodejs.org/api/zlib.html#zlib_class_zlib_gunzip</a></p>
  
  <p>But it throws: </p>
  
  <pre><code>{ [Error: incorrect header check] errno: -3, code: 'Z_DATA_ERROR' }
  </code></pre>
  
  <p>Full buffer <a href="http://pastebin.com/JnFuK4j7" rel="nofollow noreferrer">here</a></p>
  
  <p>My code:</p>
  
  <pre><code>nodeZlib.gunzip(rows[0]['Slot'+(i+1)+'AdvancedDetails'], 8, function(error, data) {
                  if(!error) {
                      console.log = data.toString();
                  } else {
                      console.log('Error unzipping:');
                      console.log(error);
                  }
              });
  </code></pre>
  
  <p>What am I doing wrong?</p>