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

Custom id generator #212

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Custom id generator #212

wants to merge 4 commits into from

Conversation

freemountain
Copy link

This adds an option for a custom id generator function.

I use nedb on an embedded Device. On this device the crypto module doesn't contain the randomBytes function which is used by nedb for generating ids.

@louischatriot
Copy link
Owner

Hello, thanks for the idea. I'll review it when I have time unfortunately probably not now. Also, note that in nedb browser version there is an id generator that doesn't use crypto, so maybe using it on an embedded device could be a good option. The minified version could be pretty well suited.

JamesMGreene added a commit to JamesMGreene/nestdb that referenced this pull request Sep 5, 2017
Also modified the ID generation integrity check to work via an iterative loop rather than via recursion

Fixes #10
Closes louischatriot/nedb#212
@jmeinke
Copy link

jmeinke commented Jan 21, 2018

This feature would help electron users which make use of NeDB to workaround electron/electron#2073. The problem is that the crypto.randomBytes is called when creating a Datastore, which freezes the app for some time because of above issue on Windows machines.

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

Successfully merging this pull request may close these issues.

3 participants