♻️ Modify UUID to allow for other versions.

This commit is contained in:
Dan Jones 2025-03-16 12:38:36 -05:00
commit fee2e3cc2f
4 changed files with 55 additions and 24 deletions

View file

@ -7,30 +7,34 @@ import (
)
func ExampleUUID() {
option := nomino.WithGenerator(nomino.UUID())
gen := nomino.UUID(nil)
str, _ := nomino.Make(nomino.NewConfig(option))
str, _ := gen.Make()
fmt.Println(str)
str, _ = nomino.Make(nomino.NewConfig(option))
str, _ = gen.Make()
fmt.Println(str)
}
func ExampleUUID_v7() {
gen := nomino.UUID(nomino.UUIDv7)
str, _ := gen.Make()
fmt.Println(str)
str, _ = nomino.Make(nomino.NewConfig(option))
str, _ = gen.Make()
fmt.Println(str)
str, _ = gen.Make()
fmt.Println(str)
}
func ExampleRandom() {
option := nomino.WithGenerator(nomino.Random())
str, _ := nomino.Make(nomino.NewConfig(option))
str, _ := nomino.Random().Make()
fmt.Println(str)
}
func ExampleRandomLength() {
option := nomino.WithGenerator(nomino.Random(
nomino.RandomLength(32),
))
str, _ := nomino.Make(nomino.NewConfig(option))
str, _ := nomino.Random(nomino.RandomLength(32)).Make()
fmt.Println(str)
}