'use strict';

var index = require('../../buffer-equal/index.js');

var equal = index.bufferEqual;
var HEADER = Buffer.from([66, 77, 70, 3]);

var isBinary = function(buf) {
  if (typeof buf === 'string')
    return buf.substring(0, 3) === 'BMF'
  return buf.length > 4 && equal(buf.slice(0, 4), HEADER)
};

exports.isBinary = isBinary;
