79091549

Date: 2024-10-15 19:57:26
Score: 0.5
Natty:
Report link

So far, the only solution I've come up with is to just append the cksum then check the file by ignoring the end bytes, and using them to check it.

(append crc) cat file | cksum -- | awk '{printf "%.8x",$1 }' >> file

(check crc) CRC=$(head -c -8 file | cksum -- | awk '{printf "%.8x",$1 }' ); [ "$(tail -c 8 file)" = "$CRC" ] && echo "pass"
Reasons:
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: Ed K