Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

explaining magic bytes

  • Loading branch information...
commit 749a4e7deefbb8932de26157a530aeeb536ebd30 1 parent ca6dc0e
@mafintosh authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 index.js
View
6 index.js
@@ -3,9 +3,9 @@ var peek = require('peek-stream')
var through = require('through2')
var isGzipped = function(data) {
- if (data.length < 10) return false
- if (data[0] !== 0x1f && data[1] !== 0x8b) return false
- if (data[2] !== 8) return false
+ if (data.length < 10) return false // gzip header is 10 bytes
+ if (data[0] !== 0x1f && data[1] !== 0x8b) return false // gzip magic bytes
+ if (data[2] !== 8) return false // is deflating
return true
}
Please sign in to comment.
Something went wrong with that request. Please try again.