code: func hexDecode(buf [lenSize]byte) (int, error) {
  	var ret int
  	for i := 0; i < lenSize; i++ {
  		n, err := asciiHexToByte(buf[i])
  		if err != nil {
  			return 0, ErrInvalidPktLen
  		}
  		ret = 16*ret + int(n)
  	}
  	return ret, nil
  }
docs: // Turns the hexadecimal representation of a number in a byte slice into
  // a number. This function substitute strconv.ParseUint(string(buf), 16,
  // 16) and/or hex.Decode, to avoid generating new strings, thus helping the
  // GC.