// Uint32 generates an uint32 id using serverID, processID and config
// if processID is zero, then the system pid will be used.
Uint32 generates an uint32 id using serverID, processID and config
if processID is zero, then the system pid will be used.
// Uint32 generates an uint32 id using serverID processID and config // if processID is zero then the system pid will be used .
func Uint32(serverID, processID uint32, c *Uint32Config) uint32 {
	if serverID == 0 {
		serverID = 1
	}
	if processID == 0 {
		processID = uint32(os.Getpid())
	}
	c.Lock()
	defer c.Unlock()
	if c.CustomEpoch <= c.LastTime {
		c.Sequence++
		if c.Sequence == (2 << (c.SequenceBits - 1)) {
			c.Sequence = 0
			c.LastTime++
		}
	} else {
		c.Sequence = 0
		c.LastTime = c.CustomEpoch
	}
	return c.LastTime<<(c.ServerBits+c.ProcessBits+c.SequenceBits) |
		(serverID&(2<<(c.ServerBits-1)))<<(c.ProcessBits+c.SequenceBits) |
		(processID & (2 << (c.ProcessBits - 1)) << c.SequenceBits) |
		c.Sequence
}
func Uint32 ( serverID , processID uint32 , c * Uint32Config ) uint32 { if serverID == 0 { serverID = 1 } if processID == 0 { processID = uint32 ( os . Getpid ( ) ) } c . Lock ( ) defer c . Unlock ( ) if c . CustomEpoch <= c . LastTime { c . Sequence ++ if c . Sequence == ( 2 << ( c . SequenceBits - 1 ) ) { c . Sequence = 0 c . LastTime ++ } } else { c . Sequence = 0 c . LastTime = c . CustomEpoch } return c . LastTime << ( c . ServerBits + c . ProcessBits + c . SequenceBits ) | ( serverID & ( 2 << ( c . ServerBits - 1 ) ) ) << ( c . ProcessBits + c . SequenceBits ) | ( processID & ( 2 << ( c . ProcessBits - 1 ) ) << c . SequenceBits ) | c . Sequence }
Uint32 generates an uint32 id using serverID, processID and config
if processID is zero, then the system pid will be used.
Uint32 generates an uint32 id using serverID processID and config if processID is zero then the system pid will be used .