modelize titles and backgrounds

This commit is contained in:
Tau
2019-11-06 17:28:29 -05:00
parent d7b510193f
commit e1454e5937
9 changed files with 11 additions and 6 deletions
+12
View File
@@ -0,0 +1,12 @@
export function bitmap(items: number[], nbytes: number): Buffer {
const buf = Buffer.alloc(nbytes);
for (const item of items) {
const byte = (item / 8) | 0;
const bit = item % 8;
buf.writeUInt8(buf.readUInt8(byte) | (1 << bit), byte);
}
return buf;
}