Char is 16 bits in Java. Therefore, char [32] should be sufficient for 512 bits. I think using byte [64] is better, although due to the fact that everyone knows that byte is 8 bits and char [32] makes the code more difficult to read. Also, you do not store characters other than bits.
source
share