1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: Apache-2.0
13 // IDGenerator generates alphanumeric strings suitable for use as
14 // unique IDs (a given IDGenerator will never return the same ID
16 type IDGenerator struct {
17 // Prefix is prepended to each returned ID.
24 // Next returns a new ID string. It is safe to call Next from multiple
26 func (g *IDGenerator) Next() string {
27 id := time.Now().UnixNano()
34 return g.Prefix + strconv.FormatInt(id, 36)