* Replace autoRef with semantic inclusion for more stable results.

* Move files around to make repository organized better.
This commit is contained in:
be5invis 2020-10-17 15:45:00 -07:00
parent 400d8f3f38
commit 7c78329244
37 changed files with 1098 additions and 761 deletions

View file

@ -1,5 +1,14 @@
"use strict";
module.exports = function maskBit(x, y) {
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];
};