(ns, type, span, key, data8)
| 39 | buf[byteIdx] &= (~(1 << bitOff)) & 0xFF; |
| 40 | }; |
| 41 | const writeHeaderEntry = (ns, type, span, key, data8) => { |
| 42 | const o = off(slot); |
| 43 | buf[o] = ns; buf[o + 1] = type; buf[o + 2] = span; buf[o + 3] = 0xFF; // chunk = 0xFF |
| 44 | for (let i = 0; i < 16; i++) buf[o + 8 + i] = i < key.length ? key.charCodeAt(i) : 0x00; |
| 45 | for (let i = 0; i < 8; i++) buf[o + 24 + i] = data8[i]; |
| 46 | const cd = new Uint8Array(28); |
| 47 | cd.set(buf.subarray(o, o + 4), 0); |
| 48 | cd.set(buf.subarray(o + 8, o + 32), 4); |
| 49 | dv.setUint32(o + 4, zlibCrc32(cd, CRC_SEED), true); |
| 50 | markWritten(slot); slot++; |
| 51 | }; |
| 52 | const writePrimitive = (ns, type, key, valBytesLE) => { |
| 53 | const d8 = new Uint8Array(8).fill(0xFF); |
| 54 | d8.set(valBytesLE, 0); |
no test coverage detected