Archived
Template
1
0

Adds godoc comments

This commit is contained in:
uberswe
2022-01-09 14:22:43 +01:00
parent 2d3c0df4e5
commit 8c37faf016
30 changed files with 154 additions and 68 deletions

14
ulid/generate.go Normal file
View File

@ -0,0 +1,14 @@
package ulid
import (
"github.com/oklog/ulid/v2"
"math/rand"
"time"
)
// Generate a new ULID string
func Generate() string {
entropy := ulid.Monotonic(rand.New(rand.NewSource(time.Now().UnixNano())), 0)
res := ulid.MustNew(ulid.Timestamp(time.Now()), entropy)
return res.String()
}