Files
unibus/pkg/membership/ulid.go
T

14 lines
315 B
Go

package membership
import (
"crypto/rand"
"github.com/oklog/ulid/v2"
)
// newULID returns a fresh, lexicographically-sortable unique id used for room
// ids. It uses crypto/rand entropy so ids are unguessable and collision-free.
func newULID() string {
return ulid.MustNew(ulid.Now(), rand.Reader).String()
}