// Apache-2.0 https://github.com/1wheel/npyjs 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};