Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

refactor: replace seedCounter w/ an instance prng #795

Merged
merged 2 commits into from
Feb 22, 2021

Conversation

davidmurdoch
Copy link
Member

I'm unsure why I implemented the wallet rng with it's own internal RNG state, but it doesn't seem neccessary.

In fact, the prng we use (alea) has a period of ~2^116 , whereas we'd start seeing weirdness at Number.MAX_SAFE_INTEGER (because Number.MAX_SAFE_INTEGER + 1 === Number.MAX_SAFE_INTEGER + 2

I'm unsure why I implemented the wallet rng with it's own internal RNG
state, but it doesn't seem neccessary.

In fact, the prng we use (alea) has a period of ~2^116 , whereas we'd
start seeing weirdness at Number.MAX_SAFE_INTEGER (because
`Number.MAX_SAFE_INTEGER + 1 === Number.MAX_SAFE_INTEGER + 2`
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant