func splitRangeString(start, end string, splits int) []string { results := []string{start} if start == end { return results } if end < start { tmp := start start = end end = tmp } // find longest common prefix between strings minLen := len(start) if len(end) < minLen { minLen = len(end) } prefix := "" for i := 0; i < minLen; i++ { if start[i] == end[i] { prefix = start[0 : i+1] } else { break } } // remove prefix from strings to split start = start[len(prefix):] end = end[len(prefix):] ordStart := stringToOrd(start) ordEnd := stringToOrd(end) tmp := new(big.Int) tmp.Sub(ordEnd, ordStart) stride := new(big.Float) stride.SetInt(tmp) stride.Quo(stride, big.NewFloat(float64(splits))) for i := 1; i <= splits; i++ { tmp := new(big.Float) tmp.Mul(stride, big.NewFloat(float64(i))) tmp.Add(tmp, new(big.Float).SetInt(ordStart)) result, _ := tmp.Int(new(big.Int)) value := prefix + ordToString(result, 0) if value != results[len(results)-1] { results = append(results, value) } } return results }