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

Add generator object in utils module #77

Open
ignatiusmb opened this issue Feb 17, 2022 · 0 comments
Open

Add generator object in utils module #77

ignatiusmb opened this issue Feb 17, 2022 · 0 comments

Comments

@ignatiusmb
Copy link
Member

a generator object would be nice for, let's say, object IDs that would start at a random hash but increments for each consecutive calls for the next ids. we could theoretically just use random.uuid for this, but it might be too random and overkill for simple cases.

it's basically a simpler uid that is not just 1, 2, 3, 4

const generate = generator();

generate(); // 128acb00
generate(); // 128acb01
generate(); // 128acb02
generate(); // 128acb03
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