hashToByteArray

Finalizes the hash computation and returns the result as a new ByteArray.