'Return a header block. info is a dictionary with file
information, format must be one of the *_FORMAT constants.'

@staticmethod
def _create_header(info, format, encoding, errors):

    parts = [stn(info.get('name', ''), 100, encoding, errors), itn((info.get('mode', 0) & 4095), 8, format), itn(info.get('uid', 0), 8, format), itn(info.get('gid', 0), 8, format), itn(info.get('size', 0), 12, format), itn(info.get('mtime', 0), 12, format), '                                ', info.get('type', REGTYPE), stn(info.get('linkname', ''), 100, encoding, errors), info.get('magic', POSIX_MAGIC), stn(info.get('uname', ''), 32, encoding, errors), stn(info.get('gname', ''), 32, encoding, errors), itn(info.get('devmajor', 0), 8, format), itn(info.get('devminor', 0), 8, format), stn(info.get('prefix', ''), 155, encoding, errors)]
    buf = struct.pack(('%ds' % BLOCKSIZE), ''.join(parts))
    chksum = calc_chksums(buf[(- BLOCKSIZE):])[0]
    buf = ((buf[:(-364)] + ('%06o\x00' % chksum).encode('ascii')) + buf[(-357):])
    return buf
