code: func (r *Range) contains(ip net.IP) (bool, int) {
  	if !r.net.Contains(ip) {
  		return false, 0
  	}
  
  	offset := calculateIPOffset(r.base, ip)
  	if offset < 0 || offset >= r.max {
  		return false, 0
  	}
  	return true, offset
  }
docs: // contains returns true and the offset if the ip is in the range, and false
  // and nil otherwise. The first and last addresses of the CIDR are omitted.