Skip to content

Instantly share code, notes, and snippets.

View e-hu's full-sized avatar

Ethan Hu e-hu

View GitHub Profile
@e-hu
e-hu / Bitmap.js
Created January 25, 2019 05:04 — forked from binarymax/Bitmap.js
Javascript bitmap data structure
//------------------------------------------
//Compact bitmap datastructure
//Memory efficient array of bool flags
var Bitmap = function(size){
this._cols = 8;
this._shift = 3;
this._rows = (size>>this._shift)+1;
this._buf = new ArrayBuffer(this._rows);
this._bin = new Uint8Array(this._buf);
};