I'm making hash algorithm, the block of message is 512 bits.
In C/C++
I can store in char[64]
, but Java
char
takes 2 bytes.
Question: 512 bits of information are char[32]
or char[64]
?
Char is 16bit in Java. So char[32] should be enough for 512bits. I think using byte[64] is better though because everyone know a byte is 8 bits and char[32] makes the code harder to read. Also you don't store characters but bits.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With