encodedFullAlphabet = {
const byteMap = [0];
for (let i = 1; i < 256; i++) byteMap[i] = i;
const charBytes = Uint8Array.from({length: 256}, (v, i) => i);
let shiftPow = BigInt(256), shift = 1n, sum = 0n;
for (let i = 0; i < charBytes.length; i++) {
const char = charBytes[i];
const charIdx = byteMap.indexOf(char);
sum = sum + shift * BigInt(charIdx);
byteMap[charIdx] = byteMap[byteMap.length - 1];
byteMap.pop();
shift *= shiftPow;
shiftPow--;
}
let encodedBits = [];
const encoded = sum;
while (sum > 0n) {
encodedBits.push(Number(sum & 1n));
sum >>= 1n;
}
return {encoded, encodedBits, originalBits: charBytes.length * 8, ratio: (encodedBits.length * 100 / (charBytes.length * 8)).toFixed(2) + "%"};
}