diff options
Diffstat (limited to 'idgen/id_generator.go')
-rw-r--r-- | idgen/id_generator.go | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/idgen/id_generator.go b/idgen/id_generator.go deleted file mode 100644 index 3659d0e..0000000 --- a/idgen/id_generator.go +++ /dev/null @@ -1,24 +0,0 @@ -package idgen - -import ( - "math/rand" - "time" -) - -const ( - chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" - - idLength = 8 -) - -func init() { - rand.Seed(time.Now().UnixNano()) -} - -func GenerateID() string { - id := make([]byte, idLength) - for i := 0; i < idLength; i++ { - id[i] = chars[rand.Intn(len(chars))] - } - return string(id) -} |