You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
354 B
16 lines
354 B
'use strict'; |
|
|
|
/** |
|
* Check if a Buffer/Uint8Array is a ZIP file |
|
* |
|
* @param {Buffer} buf |
|
* @api public |
|
*/ |
|
|
|
module.exports = function (buf) { |
|
if (!buf || buf.length < 4) { |
|
return false; |
|
} |
|
|
|
return buf[0] === 80 && buf[1] === 75 && (buf[2] === 3 || buf[2] === 5 || buf[2] === 7) && (buf[3] === 4 || buf[3] === 6 || buf[3] === 8); |
|
};
|
|
|