Files
micromdm/pkg/id/id.go
Victor Vrantchan 038fd359ae use pkg instead of internal
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.
2020-06-29 08:48:49 -04:00

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() }