Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question]: I know that is not possible to use more than 16 bit payload, but what's the reason? #71

Open
mirusky opened this issue Nov 22, 2022 · 0 comments

Comments

@mirusky
Copy link

mirusky commented Nov 22, 2022

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant