MCPcopy
hub / github.com/gofrs/uuid / NewGenWithOptions

Function NewGenWithOptions

generator.go:181–193  ·  view source on GitHub ↗

NewGenWithOptions returns a new instance of Gen with the options provided. Most people should use NewGen() or NewGenWithHWAF() instead. To customize the generator, you can pass in one or more GenOption functions. For example: gen := NewGenWithOptions( WithHWAddrFunc(myHWAddrFunc), WithE

(opts ...GenOption)

Source from the content-addressed store, hash-verified

179// NewGenWithHWAF(myHWAddrFunc)
180// NewGenWithOptions() is equivalent to calling NewGen()
181func NewGenWithOptions(opts ...GenOption) *Gen {
182 gen := &Gen{
183 epochFunc: time.Now,
184 hwAddrFunc: defaultHWAddrFunc,
185 rand: rand.Reader,
186 }
187
188 for _, opt := range opts {
189 opt(gen)
190 }
191
192 return gen
193}
194
195// WithHWAddrFunc is a GenOption that allows you to provide your own HWAddrFunc
196// function.

Calls

no outgoing calls