summaryrefslogtreecommitdiff
path: root/idgen/id_generator.go
diff options
context:
space:
mode:
authorSaumit Dinesan <justsaumit@protonmail.com>2023-09-04 19:05:57 +0530
committerSaumit Dinesan <justsaumit@protonmail.com>2023-09-04 19:05:57 +0530
commit1b9421884f3d403e3406e61cee742bd03d3a0fa5 (patch)
tree2d956abc98a3ff3dc84195c3bad5a0aa2268e95b /idgen/id_generator.go
parent117d461c4944f189576f0c4967851de458ba6f32 (diff)
Refactoring code
Diffstat (limited to 'idgen/id_generator.go')
-rw-r--r--idgen/id_generator.go5
1 files changed, 0 insertions, 5 deletions
diff --git a/idgen/id_generator.go b/idgen/id_generator.go
index 8c34f41..3659d0e 100644
--- a/idgen/id_generator.go
+++ b/idgen/id_generator.go
@@ -1,4 +1,3 @@
-// id_generator.go
package idgen
import (
@@ -7,19 +6,15 @@ import (
)
const (
- // Define the character set for the generated IDs.
chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
- // Define the desired length of the generated IDs.
idLength = 8
)
-// Initialize the random number generator.
func init() {
rand.Seed(time.Now().UnixNano())
}
-// GenerateID generates a short and readable ID.
func GenerateID() string {
id := make([]byte, idLength)
for i := 0; i < idLength; i++ {