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

Do you mind not generate the auto seed from the whole global object? #9

Open
poppinlp opened this issue Aug 26, 2020 · 2 comments
Open

Comments

@poppinlp
Copy link

Hi. Thanks for the nice tool. I get here from the mathjs.

Right now, if there's no crypto on global, we will use this as the default seed: [+new Date, GLOBAL, GLOBAL.navigator && GLOBAL.navigator.plugins, GLOBAL.screen, tostring(pool)];. And then do flatten to it and convert it to a string.

But, actually, there could be some problems with this since we don't know what is existed in the user's global environment. For example, if the global environment has some Symbol values or nested Symbol values in-depth 3, then it will break by TypeError: Cannot convert a Symbol value to a string.

It's just one case that may crash the program. And there may be some others. So, I think maybe we should not use the whole user global object and do operators to it. It's a little bit out of control.

@poppinlp poppinlp changed the title Do you mind the auto seed not generated from the whole global? Do you mind not generate the auto seed from the whole global object? Aug 26, 2020
@poppinlp
Copy link
Author

poppinlp commented Aug 26, 2020

Looks like we want to get some data varies from person to person. The current navigator and screen seem to designed for the browser. And for nodejs, maybe we could use something like process.env which consists of just string pair.

And for the new Date, we could have more detailed time via performance.now for browser and process.hrtime for nodejs to make it more special.

@poppinlp
Copy link
Author

Hi. Do you mind it? I could make a PR for it. :)

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