Example #1
0
func calcRandom(ch chan [1000]string, queCounter *count.QueCounter) {
	var orders [1000]string
	for i := 0; i < 1000; i++ {
		orders[i] = count.Random64(queCounter, "CID64")
	}
	ch <- orders
}
Example #2
0
func (u *UUIDGenerator) GetCurrentID(bizCode string, token string, num int16) (r *uuid.UUIDResponse, err error) {
	check := checkRequest(bizCode, token, num)
	if check != nil {
		return check, nil
	}

	result := make([]string, num)
	var i int16
	for i = 0; i < num; i++ {
		number := count.Random64(global.QueCounter, global.MachineCode)
		if nil == &number || "" == number {
			return resultErrorUnknown, nil
		}
		result[i] = number
	}

	return &uuid.UUIDResponse{uuid.ResponseCode_OK, "", result}, nil
}