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.
8 lines
243 B
8 lines
243 B
|
2 months ago
|
var equal = require('buffer-equal')
|
||
|
|
var HEADER = Buffer.from([66, 77, 70, 3])
|
||
|
|
|
||
|
|
module.exports = function(buf) {
|
||
|
|
if (typeof buf === 'string')
|
||
|
|
return buf.substring(0, 3) === 'BMF'
|
||
|
|
return buf.length > 4 && equal(buf.slice(0, 4), HEADER)
|
||
|
|
}
|