mirror of
https://github.com/micromdm/micromdm/
synced 2026-08-05 17:05:51 +08:00
internal/ is too limiting, and by using pkg/ we can use the libraries in our own projects elsewhere. The netlify-functions/vanity service uses pkg/log already.
13 lines
310 B
Go
13 lines
310 B
Go
// Package id implements a unique identifier.
|
|
package id
|
|
|
|
import (
|
|
"crypto/rand"
|
|
|
|
"github.com/oklog/ulid/v2"
|
|
)
|
|
|
|
// New returns a unique identifier.
|
|
// The format is a Universally Unique Lexicographically Sortable Identifier (ULID).
|
|
func New() string { return ulid.MustNew(ulid.Now(), rand.Reader).String() }
|