Organize support files and simplify imports

This commit is contained in:
be5invis 2021-07-15 21:14:08 -07:00
parent 70f41352c1
commit ef203af85a
178 changed files with 61 additions and 269 deletions

View file

@ -0,0 +1,14 @@
"use strict";
exports.maskBit = function maskBit(x, y) {
return x & (1 << y);
};
exports.maskBits = function maskBits(x, y) {
return x & y;
};
const pcNibbleLookup = [0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4];
exports.popCountByte = function (x) {
return pcNibbleLookup[x & 0x0f] + pcNibbleLookup[(x >>> 4) & 0x0f];
};