withChecksum

Prepends a SHA-256 checksum of this data, for detecting accidental corruption.

The checksum is unkeyed, so it is not tamper-proof: anyone who can modify the data can recompute it. Use a keyed MAC such as HMAC-SHA256 when the data must be authenticated.