0.2.0 • Published 7 years ago

is-iso v0.2.0

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

is-iso Build Status codecov

Check if a Buffer/Uint8Array is an ISO image.

Install

$ npm install is-iso

Usage

Node.js

var readChunk = require('read-chunk'); // npm install read-chunk
var isIso = require('is-iso');
var buffer = readChunk.sync('unicorn.iso', 0, 36870);

isIso(buffer);
//=> true

Browser

var xhr = new XMLHttpRequest();
xhr.open('GET', 'unicorn.iso');
xhr.responseType = 'arraybuffer';

xhr.onload = function () {
	isIso(new Uint8Array(this.response));
	//=> true
};

xhr.send();

API

isIso(buffer)

Accepts a Buffer (Node.js) or Uint8Array.

It only needs the first 36870 bytes.

License

MIT © undisk