I wish this help you You don't say what system you are doing this on, but you may need to open with "rb" instead of "r" to assure that there are no end-of-line translations on the read data. It is good practice to put that in anyway for portability and to document that you are considering the input to be binary data.
CRC32 checksum is not getting calculated in node.js
Any of those help The only thing I can think of is that the write is not finished by the time you do the readFileSync(). Can you check if the file exists before reading ? I am also wondering if it's not in fact a duplicate of this.
Calculated tcp checksum and original tcp checksum don't match