9 // IDGenerator generates alphanumeric strings suitable for use as
10 // unique IDs (a given IDGenerator will never return the same ID
12 type IDGenerator struct {
13 // Prefix is prepended to each returned ID.
20 // Next returns a new ID string. It is safe to call Next from multiple
22 func (g *IDGenerator) Next() string {
23 id := time.Now().UnixNano()
30 return g.Prefix + strconv.FormatInt(id, 36)