17 lines
290 B
Go
17 lines
290 B
Go
package shared
|
|
|
|
import (
|
|
"github.com/google/uuid"
|
|
"github.com/nrednav/cuid2"
|
|
|
|
"git.mstar.dev/mstar/linstrom/config"
|
|
)
|
|
|
|
// Generate a new string ID
|
|
func NewId() string {
|
|
if config.GlobalConfig.Experimental.UseCuid2Ids {
|
|
return cuid2.Generate()
|
|
} else {
|
|
return uuid.NewString()
|
|
}
|
|
}
|