code: func Decode(dst, src []byte) (int, error) {
  	var i int
  	for i = 0; i < len(src)/2; i++ {
  		a, ok := fromHexChar(src[i*2])
  		if !ok {
  			return i, InvalidByteError(src[i*2])
  		}
  		b, ok := fromHexChar(src[i*2+1])
  		if !ok {
  			return i, InvalidByteError(src[i*2+1])
  		}
  		dst[i] = (a << 4) | b
  	}
  	if len(src)%2 == 1 {
  		// Check for invalid char before reporting bad length,
  		// since the invalid char (if present) is an earlier problem.
  		if _, ok := fromHexChar(src[i*2]); !ok {
  			return i, InvalidByteError(src[i*2])
  		}
  		return i, ErrLength
  	}
  	return i, nil
  }
docs: // Decode decodes src into DecodedLen(len(src)) bytes,
  // returning the actual number of bytes written to dst.
  //
  // Decode expects that src contains only hexadecimal
  // characters and that src has even length.
  // If the input is malformed, Decode returns the number
  // of bytes decoded before the error.