How to calculate IPFS multihash from the result of "ipfs cat"

I need to validate the authenticity of the file which I get using ā€œipfs catā€. I prefer to not trust ipfs client, so I want to validate the hash by myself.
My question is following: How to compose the full ā€œblockā€ from which IPFS multihash is calculated?