func (l *LimitOrder) SetID() error {
	s1 := rand.NewSource(time.Now().UnixNano())
	r1 := rand.New(s1)

	randNonce := r1.Int63n(math.MaxInt64)
	structBytes := []byte(fmt.Sprintf("%v%x", l, randNonce))

	sha := sha256.New()
	_, err := sha.Write(structBytes)
	if err != nil {
		return err
	}

	l.OrderID = fmt.Sprintf("%x", sha.Sum(nil))
	return nil
}
// SetID sets an ID for the order, it's going to be different if you call it twice but we're only ever going to call it once
SetID sets an ID for the order, it's going to be different if you call it twice but we're only ever going to call it once
// SetID sets an ID for the order it ' s going to be different if you call it twice but we ' re only ever going to call it once
func (l *LimitOrder) SetID() error {
	s1 := rand.NewSource(time.Now().UnixNano())
	r1 := rand.New(s1)
	randNonce := r1.Int63n(math.MaxInt64)
	structBytes := []byte(fmt.Sprintf("%v%x", l, randNonce))
	sha := sha256.New()
	_, err := sha.Write(structBytes)
	if err != nil {
		return err
	}
	l.OrderID = fmt.Sprintf("%x", sha.Sum(nil))
	return nil
}
func ( l * LimitOrder ) SetID ( ) error { s1 := rand . NewSource ( time . Now ( ) . UnixNano ( ) ) r1 := rand . New ( s1 ) randNonce := r1 . Int63n ( math . MaxInt64 ) structBytes := [ ] byte ( fmt . Sprintf ( " " , l , randNonce ) ) sha := sha256 . New ( ) _ , err := sha . Write ( structBytes ) if err != nil { return err } l . OrderID = fmt . Sprintf ( " " , sha . Sum ( nil ) ) return nil }
SetID sets an ID for the order, it's going to be different if you call it twice but we're only ever going to call it once
SetID sets an ID for the order it ' s going to be different if you call it twice but we ' re only ever going to call it once