<p>For all all 32 pieces still on the board, there is a bound of 1.89x10<sup>33</sup> states. That could be encoded in 14 bytes. See <a href="https://arxiv.org/pdf/2112.09386.pdf" rel="nofollow noreferrer">https://arxiv.org/pdf/2112.09386.pdf</a> . Not sure how that's useful though, since there is such a thing as captures. You'd also need to handle other possible sets of pieces, due to promotions.</p>
Minimize bytes to save chess state with all figures
<p>I want to minimize the bytes need when i save a chess state with all figures:
Currently i need about 18 bytes to store the full board. I simply encode the possible positions for White King and other figures in some number.</p>
<pre><code>BigInteger big1 = ZERO;
BigInteger small1 = ONE;


big1 = big1.add(small1.multiply(tn.binomialCache(64,1, cache).subtract(ONE))); // White K
small1 = small1.multiply(tn.binomialCache(64,1, cache));
big1 = big1.add(small1.multiply(tn.binomialCache(63,1, cache).subtract(ONE))); // White Q
small1 = small1.multiply(tn.binomialCache(63,1, cache));
big1 = big1.add(small1.multiply(tn.binomialCache(62,1, cache).subtract(ONE))); // Black K
small1 = small1.multiply(tn.binomialCache(62,1, cache));
big1 = big1.add(small1.multiply(tn.binomialCache(61,1, cache).subtract(ONE))); // Black Q
small1 = small1.multiply(tn.binomialCache(61,1, cache));
big1 = big1.add(small1.multiply(tn.binomialCache(60,2, cache).subtract(ONE))); // White T
small1 = small1.multiply(tn.binomialCache(60,2, cache));
big1 = big1.add(small1.multiply(tn.binomialCache(58,2, cache).subtract(ONE))); // Black T
small1 = small1.multiply(tn.binomialCache(58,2, cache));
big1 = big1.add(small1.multiply(tn.binomialCache(56,2, cache).subtract(ONE))); // White H
small1 = small1.multiply(tn.binomialCache(56,2, cache));
big1 = big1.add(small1.multiply(tn.binomialCache(54,2, cache).subtract(ONE))); // Black H
small1 = small1.multiply(tn.binomialCache(54,2, cache));
big1 = big1.add(small1.multiply(tn.binomialCache(52,2, cache).subtract(ONE))); // White R
small1 = small1.multiply(tn.binomialCache(52,2, cache));
big1 = big1.add(small1.multiply(tn.binomialCache(50,2, cache).subtract(ONE))); // Black R 
small1 = small1.multiply(tn.binomialCache(50,2, cache));
big1 = big1.add(small1.multiply(tn.binomialCache(48,8, cache).subtract(ONE))); // White P
small1 = small1.multiply(tn.binomialCache(48,8, cache));
big1 = big1.add(small1.multiply(tn.binomialCache(40,8, cache).subtract(ONE))); // Black P

// nummber of states which a full chessboard can have
// big1 = 4634726695587809641192045982323285670400000
</code></pre>
<p>Its possible do encode/decode the state of a chess board with all figures to less to than 18bytes?</p>