while (rest >= pow) { // create symbols to compressed string
            powC = pow - 1; // try with a short symbol length
            code = parseInt(revString(((achr & ((1 << powC) - 1)) + (1 << powC)).toString(2)), 2) >> 1;

            if (code >= lowhi) {powC += 1; } // if we get code of long length symbols