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

How does one establish a seed value for underlying chance library #33

Open
peternhale opened this issue Oct 3, 2019 · 2 comments
Open
Assignees

Comments

@peternhale
Copy link

In previous release one had access to the Generators constructor where a seed value could be supplied. How does one accomplish the same in v3?

Also does one have access the chance instance, a getter or some other means?

Thanks in advance.

@sunesimonsen
Copy link
Owner

Hi @peternhale, I'm very sorry that I have broken the API for you, I take that kind of change very serious. The new version is always seeded, so you don't have to do anything if you just need a seeded generator. If you need to use another seed, you can get values for a given seed: https://sunesimonsen.github.io/chance-generators/api/generator/#take-n-options-

But we have discussed, also providing a way to get generators for a given seed:

const { generators } = require('chance-generators')

const { natural, string } = generators({ seed: 666 })

@sunesimonsen
Copy link
Owner

What is your use-cases by the way?

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

2 participants