code: func IsSaltpackArmored(stream *bufio.Reader) (brand string, msgType MessageType, ver Version, err error) {
  
  	// temporary hack to compute stream.Size(), which is only available from go 1.10
  	// TODO remove after we can drop support for go 1.9 or older.
  	// If the buffer is larger then 8192, we use the first 8192 bytes (which should be
  	// enough to decode one block in the vast majority of cases)
  	sizePlusOne := sort.Search(8192, func(i int) bool {
  		_, peekErr := stream.Peek(i)
  		return peekErr == bufio.ErrBufferFull
  	})
  
  	buf, err := stream.Peek(sizePlusOne - 1)
  	if (err != nil && err != io.EOF) || len(buf) == 0 {
  		return "", MessageTypeUnknown, ver, err
  	}
  
  	return IsSaltpackArmoredPrefix(string(buf))
  }
docs: // IsSaltpackArmored peeks into the provided bufio.Reader to determine whether it encodes an ASCII-armored saltpack message.
  // It does not consume any of the reader's bytes. The buffer size of the reader must be sufficient to contain the header frame plus
  // the first Base62 encoded block of the payload. It returns a non nil error if the buffer
  // size of the reader is not large enough to make this determination (ErrShortSliceOrBuffer), or if the stream does not appear to contain a valid
  // saltpack message. If err is nil, then the brand, version and expected type of the message will be returned, but this does *NOT* guarantee that the
  // rest of the message is well formed.