thedesk/app/node_modules/load-bmfont/lib/is-binary.js

8 lines
242 B
JavaScript
Raw Normal View History

2018-02-19 04:41:25 +11:00
var equal = require('buffer-equal')
var HEADER = new Buffer([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)
}