# How to hash a structure that needs to include that hash's outcome?

so I am busy writing a TCP protocol in which I send a "packet header" with each packet of data. This packet header is a structure that contains information about the data that was sent. I want to verify whether the header was tampered with in some manner and I am thinking of using a hash of the header to ensure it was not tampered with. I want to know if it is possible to include this hash in the header itself. Here is what the packet header looks like.

struct PACKET_HEADER
{
DWORD dwMagic;
BYTE lpvChecksum[32];



I am not sure if this method will work and I am open to any other suggestions on how to verify the header.

Thanks

-