

Show HN: Chance – Random generator library for JS – my weekend project - vaporstun
http://chancejs.com

======
niknak24
are you obtaining entropy through mouse and keyboard interactions?

~~~
vaporstun
There is no entropy generation here, it is based on the Mersenne Twister, so
it is pseudo-random only at this point. If none is provided, the seed is just
the current timestamp.

I discuss this a bit more in the docs:
[http://chancejs.com/#todo](http://chancejs.com/#todo)

This is good for repeatability, bad if "true random" is needed.

Problem is, this is very tricky. I'd like to add it at some point, but finding
a way to add entropy that works both in the browser and in Node would be quite
difficult. For example, I could use mouse/keyboard in browser, but not in some
server app running on node.

I could use an external service (like random.org) as the underlying random (I
built it in such a way that this was easily swappable/replaceable), but then
I'm adding network latency. I show an example like this in the docs:
[http://chancejs.com/#browser](http://chancejs.com/#browser)

So for now I'm punting on it, with a plan to revisit later.

