code: func NewAllocator(ipr *IPRange) *IPRangeAllocator {
  	a := &IPRangeAllocator{
  		ipRange:     ipr,
  		reserved:    make(map[int64]bool),
  		startIsIPv4: bytes.Compare(ipr.Start.To16()[0:12], ipv6in4) == 0,
  	}
  
  	// calculate the size of the range
  	a.startBig = big.NewInt(0)
  	a.startBig.SetBytes(a.ipRange.Start)
  	endBig := big.NewInt(0)
  	endBig.SetBytes(a.ipRange.End)
  	sizeBig := endBig.Sub(endBig, a.startBig)
  
  	// 1 is added to the size because the end IP is inclusive
  	a.size = sizeBig.Int64() + 1
  	a.remaining = a.size
  
  	return a
  }
docs: // NewAllocator creates a new IPRangeAllocator for the provided IPRange.