If there's no technical problem could make it configurable? Like:
// It will return a configurable instance.
instance := ksuid.NewInstance(ksuid.Config{
MaxPayloadLength: 32,
})
And if possible a method to replace the global instance like golang zap:
instance := ksuid.NewInstance(ksuid.Config{
MaxPayloadLength: 32,
})
// instance will create a 32 bit payload while ksuid.New() will create a 16 bit payload.
// to avoid that we could do something like:
undo := ksuid.ReplaceGlobals(instance)
defer undo()
// here the ksuid and instance are both configurable in the same way so I could call
// ksuid.New() or instance.New() and both will create a 32 bit payload.