aed38433ae
Foundation layer: entities table with card support, entity_tags join table, WAL mode, busy_timeout, full CRUD operations including promote/demote lifecycle and soft/hard delete. 33 tests passing.
21 lines
291 B
Go
21 lines
291 B
Go
package ulid
|
|
|
|
import (
|
|
"crypto/rand"
|
|
"sync"
|
|
|
|
"github.com/oklog/ulid/v2"
|
|
)
|
|
|
|
var (
|
|
entropy *ulid.MonotonicEntropy
|
|
entropyOnce sync.Once
|
|
)
|
|
|
|
func New() string {
|
|
entropyOnce.Do(func() {
|
|
entropy = ulid.Monotonic(rand.Reader, 0)
|
|
})
|
|
return ulid.MustNew(ulid.Now(), entropy).String()
|
|
}
|