code: func readHeader(br *bufio.Reader) (consumed int, digest []byte, size uint32, err error) {
  	line, err := br.ReadSlice(']')
  	if err != nil {
  		return
  	}
  	const minSize = len("[b-c 0]")
  	sp := bytes.IndexByte(line, ' ')
  	size64, err := strutil.ParseUintBytes(line[sp+1:len(line)-1], 10, 32)
  	if len(line) < minSize || line[0] != '[' || line[len(line)-1] != ']' || sp < 0 || err != nil {
  		return 0, nil, 0, errors.New("diskpacked: invalid header reader")
  	}
  	return len(line), line[1:sp], uint32(size64), nil
  }
docs: // readHeader parses "[sha1-fooooo 1234]" from r and returns the
  // number of bytes read (including the starting '[' and ending ']'),
  // the blobref bytes (not necessarily valid) and the number as a
  // uint32.
  // The consumed count returned is only valid if err == nil.
  // The returned digest slice is only valid until the next read from br.