Aktueller Stand

This commit is contained in:
2026-01-23 01:33:35 +01:00
parent 082dc5e110
commit 2766dd12c5
10109 changed files with 1578841 additions and 77685 deletions

View File

@@ -0,0 +1,29 @@
import { MASK } from "./config.js";
/**
* Hamming weight.
*
* Taken from: http://jsperf.com/hamming-weight
*
* @internal
*/
export function popcount(x) {
x -= x >> 1 & 0x55555555;
x = (x & 0x33333333) + (x >> 2 & 0x33333333);
x = x + (x >> 4) & 0x0f0f0f0f;
x += x >> 8;
x += x >> 16;
return x & 0x7f;
}
/** @internal */
export function hashFragment(shift, h) {
return h >>> shift & MASK;
}
/** @internal */
export function toBitmap(x) {
return 1 << x;
}
/** @internal */
export function fromBitmap(bitmap, bit) {
return popcount(bitmap & bit - 1);
}
//# sourceMappingURL=bitwise.js.map