core/utils/identity.go

16 lines
241 B
Go
Raw Normal View History

2025-02-07 13:01:38 +08:00
package utils
import (
2025-03-12 17:10:04 +08:00
"github.com/google/uuid"
2025-02-07 13:01:38 +08:00
ulid "github.com/oklog/ulid/v2"
)
2025-03-12 17:10:04 +08:00
func UUID() string {
return uuid.Must(uuid.NewV7()).String()
}
2025-02-07 13:01:38 +08:00
// remove nanoid,uuid,replace to ulid
func ULID() string {
return ulid.Make().String()
}