UNPKG
is-gzip
Version:
latest (2.0.0)
2.0.0
1.0.0
0.1.0
Check if a Buffer/Uint8Array is a GZIP file
github.com/kevva/is-gzip
kevva/is-gzip
is-gzip
/
index.js
9 lines
(7 loc)
•
157 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
'use strict'
;
module
.
exports
=
buf
=>
{
if
(!buf || buf.
length
<
3
) {
return
false
; }
return
buf[
0
] ===
0x1F
&& buf[
1
] ===
0x8B
&& buf[
2
] ===
0x08
; };