Xref: utzoo comp.unix.questions:5425 comp.unix.wizards:6388 comp.unix.xenix:1430 Path: utzoo!mnetor!uunet!mcvax!diku!dde!phn From: phn@dde.uucp (Per H. Nielsen) Newsgroups: comp.unix.questions,comp.unix.wizards,comp.unix.xenix Subject: Re: chksum in tar header block Message-ID: <145@Giraf.dde.uucp> Date: 2 Feb 88 17:16:16 GMT References: <243@mancol.UUCP> Organization: Dansk Data Elektronik A/S, Herlev, Denmark Lines: 21 Keywords: tar,header,chksum Summary: How is tar checksum computed In article <243@mancol.UUCP>, samperi@mancol.UUCP (Dominick Samperi) writes: > Can somebody explain how the chksum in a tar header block is computed? My > docs say that it is equal to the sum of the bytes in the 512-byte header, > assuming that all bytes of the checksum itself are blanks. > On the other hand, when I dump a tar archive from > either system I can't seem to compute a checksum by hand that > agrees with the figure displayed. It is correct that the checksum is the sum of the 512 header bytes after filling the checksum field itself with spaces. The checksum is then written as a string giving the *octal* representation of the checksum. Maybe you forgot to convert your hand computed sum to octal ??. -- +---------------------------------------------------------------------------+ | Per H. Nielsen @ Dansk Data Elektronik A/S, | | E-mail: ..!uunet!mcvax!diku!dde!phn or phn@dde.uucp | +---------------------------------------------------------------------------+