2014-06-24 04:00:39 +00:00
|
|
|
/** Break the file up into sectors */
|
2017-07-28 17:53:08 +00:00
|
|
|
function sectorify(file/*:RawBytes*/, ssz/*:number*/)/*:Array<RawBytes>*/ {
|
2014-06-24 04:00:39 +00:00
|
|
|
var nsectors = Math.ceil(file.length/ssz)-1;
|
2017-07-28 17:53:08 +00:00
|
|
|
var sectors/*:Array<RawBytes>*/ = [];
|
2014-06-24 04:00:39 +00:00
|
|
|
for(var i=1; i < nsectors; ++i) sectors[i-1] = file.slice(i*ssz,(i+1)*ssz);
|
|
|
|
sectors[nsectors-1] = file.slice(nsectors*ssz);
|
|
|
|
return sectors;
|
|
|
|
}
|
|
|
|
|