logoalt Hacker News

mort96today at 7:43 PM2 repliesview on HN

If that's the purpose, couldn't you store the hash and throw away the compressed image?

(As others said, compression is deterministic for the same algorithm, parameters and input data)


Replies

a_t48today at 8:05 PM

Zstd for example only promises determinism on the same version of the library. I've personally seen the hashes mutate between pull and export. Things like tar padding also make a difference. Really, the thing to do is to hash on the _uncompressed_ data and let compression be a transport/registry detail. That's what I've done, at least.

show 1 reply
cpuguy83today at 9:38 PM

The whole entire reason is compression is not deterministic across tooling.