// ParseID parses ID and checks if it's correct
355216
func ParseID(id string) (*ID, error) {
	val := uuid.Parse(id)
	if val == nil {
		return nil, trace.BadParameter("'%v' is not a valid Time UUID v1", id)
	}
	if ver, ok := val.Version(); !ok || ver != 1 {
		return nil, trace.BadParameter("'%v' is not a be a valid Time UUID v1", id)
	}
	uid := ID(id)
	return &uid, nil
}
173417
func (s *ExplainService) Id(id string) *ExplainService {
	s.id = id
	return s
}
486580
func (s *GetTemplateService) Id(id string) *GetTemplateService {
	s.id = id
	return s
}
605326
func (m BinaryFloatMapper) ID(fi ...interface{}) (rowIDs []int64, err error) {
	// TODO implement (have to redo the Mapper interface to handle slice)
	return []int64{0}, nil
}
1190612
func (s *SliceQuery) Id(id int) *SliceQuery {
	s.id = &id
	return s
}
680394
func ParseUID(value string) (uint32, error) {
	uid, err := strconv.ParseUint(value, 10, 32)
	if err != nil {
		return 0, vterrors.Wrap(err, "bad tablet uid")
	}
	return uint32(uid), nil
}
80088
func ParseIntBytes(id [8]byte) ID {
	return ID(int64(binary.BigEndian.Uint64(id[:])))
}
1242606
func (c *Connection) ID() int {
	c.RLock()
	defer c.RUnlock()
	return c.id
}
627334
func ParseUIDGID(str string) (uid uint32, gid uint32, err error) {
	if str == "" {
		return 0, 0, nil
	}
	parts := strings.SplitN(str, ":", 2)
	if len(parts) == 1 {
		return 0, 0, errors.New("groups ID is not provided")
	}
	if uid, err = parseUID(parts[0]); err != nil {
		return 0, 0, err
	}
	if gid, err = parseUID(parts[1]); err != nil {
		return 0, 0, err
	}
	return
}
58458
func ParseIDMap(mapSpec []string, mapSetting string) (idmap []IDMap, err error) {
	stdErr := fmt.Errorf("error initializing ID mappings: %s setting is malformed", mapSetting)
	for _, idMapSpec := range mapSpec {
		idSpec := strings.Fields(strings.Map(nonDigitsToWhitespace, idMapSpec))
		if len(idSpec)%3 != 0 {
			return nil, stdErr
		}
		for i := range idSpec {
			if i%3 != 0 {
				continue
			}
			cid, hid, size, err := parseTriple(idSpec[i : i+3])
			if err != nil {
				return nil, stdErr
			}
			// Avoid possible integer overflow on 32bit builds
			if bits.UintSize == 32 && (cid > math.MaxInt32 || hid > math.MaxInt32 || size > math.MaxInt32) {
				return nil, stdErr
			}
			mapping := IDMap{
				ContainerID: int(cid),
				HostID:      int(hid),
				Size:        int(size),
			}
			idmap = append(idmap, mapping)
		}
	}
	return idmap, nil
}
796170
func (i *ID) Decode(b []byte) error {
	if len(b) != IDLength {
		return ErrInvalidIDLength
	}

	res, err := strconv.ParseUint(unsafeBytesToString(b), 16, 64)
	if err != nil {
		return err
	}

	if *i = ID(res); !i.Valid() {
		return ErrInvalidID
	}
	return nil
}
35121
func VerifyID(encodedEncryptedData []byte, id ID) error {
	return id.h.Verify(encodedEncryptedData)
}
14028
func (session *Session) ID(id interface{}) *Session {
	session.Statement.Id(id)
	return session
}
755673
func (s *Statement) Id(name string) *Statement {
	t := token{
		typ:     identifierToken,
		content: name,
	}
	*s = append(*s, t)
	return s
}
720157
func (s *GetScriptService) Id(id string) *GetScriptService {
	s.id = id
	return s
}
169838
func ParseBytes(id []byte) (ID, error) {
	i, err := strconv.ParseInt(string(id), 10, 64)
	return ID(i), err
}
191755
func (s *ExistsService) Id(id string) *ExistsService {
	s.id = id
	return s
}