From the Javadoc for digest()
:
Completes the hash computation by performing final operations such as padding. The digest is reset after this call is made.
Call digest()
once and put the results into a variable.
(By the way, had you searched for the digest, which is always a good idea whenever you get a fixed result, you would have seen that it's the SHA-256 digest for the empty string.)