code: func getSizeOfPayloadSizeField(payload []byte) int {
  	s := 1
  	for i := len(payload); i >= 256; i /= 256 {
  		s++
  	}
  	return s
  }
docs: // getSizeOfPayloadSizeField returns the number of bytes necessary to encode the size of payload