iex
05/03/2020, 12:37 PMupdate
on MessageDigest
like this append or overwrite the data?
val digest = MessageDigest.getInstance("SHA-256")
digest.update("foo".toByteArray())
digest.update("bar".toByteArray())
I see in the source that update
calls engineUpdate(input, 0, input.length);
, which:
/**
* Updates the digest using the specified array of bytes,
* starting at the specified offset.
*
This makes me thing that it overwrites the data, but the first snippet seems to work, so I'm confused