private int encode928(int bitLng) {
        int i, j, b, bitCnt, cwNdx, cwCnt, cwLng;
        for (cwNdx = cwLng = b = 0; b < bitLng; b += 69, cwNdx += 7) {
            bitCnt = min(bitLng - b, 69);
            cwLng += cwCnt = bitCnt / 10 + 1;
            for (i = 0; i < cwCnt; i++) {
                codeWords[cwNdx + i] = 0; /* init 0 */
            }
            for (i = 0; i < bitCnt; i++) {
                if (getBit(b + bitCnt - i - 1)) {
                    for (j = 0; j < cwCnt; j++) {
                        codeWords[cwNdx + j] += pwr928[i][j + 7 - cwCnt];
                    }
                }
            }
            for (i = cwCnt - 1; i > 0; i--) {
                /* add "carries" */
                codeWords[cwNdx + i - 1] += codeWords[cwNdx + i] / 928L;
                codeWords[cwNdx + i] %= 928L;
            }
        }
        return (cwLng);
    }
private int encode928 ( int bitLng ) { int i , j , b , bitCnt , cwNdx , cwCnt , cwLng ; for ( cwNdx = cwLng = b = 0 ; b < bitLng ; b += 69 , cwNdx += 7 ) { bitCnt = min ( bitLng - b , 69 ) ; cwLng += cwCnt = bitCnt / 10 + 1 ; for ( i = 0 ; i < cwCnt ; i ++ ) { codeWords [ cwNdx + i ] = 0 ; } for ( i = 0 ; i < bitCnt ; i ++ ) { if ( getBit ( b + bitCnt - i - 1 ) ) { for ( j = 0 ; j < cwCnt ; j ++ ) { codeWords [ cwNdx + j ] += pwr928 [ i ] [ j + 7 - cwCnt ] ; } } } for ( i = cwCnt - 1 ; i > 0 ; i -- ) { codeWords [ cwNdx + i - 1 ] += codeWords [ cwNdx + i ] / 928L ; codeWords [ cwNdx + i ] %= 928L ; } } return ( cwLng ) ; }
/* converts bit string to base 928 values, codeWords[0] is highest order