INNER CODE UNIT · JavaScript
maxN
jonasstrehle/supercookie · server/main.js:76
const maxN = 2 ** N - 1;
webserver_1.options('*', cors());
webserver_2.options('*', cors());
console.info(`supercookie | Starting up using N=${N}, C-ID='${CACHE_IDENTIFIER}' ...`);
console.info(`supercookie | There are ${Math.max(maxN - 1 - (STORAGE.index ?? 1), 0)}/${maxN - 1} unique identifiers left.`);
let Webserver = (() => {
class Webserver {
static getVector(identifier) {
const booleanVector = (identifier >>> 0).toString(2)
.padStart(this.routes.length, '0').split('')
.map((element) => element === '1')
.reverse();
const vector = new Array();
booleanVector.forEach((value, index) => value ? vector.push(this.getRouteByIndex(index)) : void 0);
return vector;
}
static getIdentifier(vector, size = vector.size) {
return parseInt(this.routes.map((route) => vector.has(route) ? 0 : 1)