MCPcopy Create free account
hub / github.com/sindresorhus/query-string / distinctEncodings

Function distinctEncodings

test/parse.js:1420–1424  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1418 const leadBytes = [0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xEE, 0xEF];
1419 // Every run decodes to a different character, so each one is distinct.
1420 const distinctEncodings = count => Array.from({length: count}, (_, index) =>
1421 percentByte(leadBytes[index % leadBytes.length])
1422 + percentByte(0x80 + (Math.floor(index / leadBytes.length) % 64))
1423 + percentByte(0x80 + (Math.floor(index / (leadBytes.length * 64)) % 64)),
1424 ).join('z');
1425
1426 const count = 4000;
1427 const baselineQuery = `a=${distinctEncodings(count)}`;

Callers 1

parse.jsFile · 0.85

Calls 1

percentByteFunction · 0.85

Tested by

no test coverage detected