// Package uuid provides unique ID generation helpers. package uuid import ( "github.com/gogf/gf/v2/util/grand" "github.com/gogf/gf/v2/util/guid" ) // New returns a 32-character unique ID without dashes. func New() string { return guid.S() } // Short returns a random alphanumeric ID of length n (defaults to 8 when n <= 0). // Suitable for short invite codes / trace ids. func Short(n int) string { if n <= 0 { n = 8 } return grand.S(n) }