Skip to content

Exclude reserved IDs - how? #35

Description

@hrstoyanov

Thanks for this well-design library!

There are use cases where the database system need to be bootstrapped with a few "well known" ids, while the rest of the data entities can be generated tsid as usual. (Example: you are creating an user database where the "admin" user must be with id=0, all other users can be get their IDs with Tsid::fast, or TsidCreator::getTsid, but should never receive 0)

Is there an easy way to generating tsids by excluding certain reserved values? I can see a way how to do that with some sort of skipping factory, but was hoping for something built-in, a "creator" that takes a list of "avoid-these-values" argument..

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions