// https://github.com/aplbrain/npyjs/blob/master/LICENSE const dtypes = { ' '\x20').join(''); const hl = (header + spacepad).length; return Buffer.concat([ Buffer.from('\x93NUMPY\x01\x00', 'latin1'), // convert to little-endian Buffer.from(new Uint8Array([hl % 256, hl/256 | 0])), Buffer.from(header + spacepad, 'latin1'), Buffer.from(typedArray.buffer) ]); } export default {parse, format};