You are viewing a single comment's thread from:

RE: Steem Monsters Tech Talk - Steem Blockchain Integration

in #steemmonsters7 years ago

You could use the transaction ID as the seed to your random number generator of choice and then generate those N numbers from that generator in a consistent fashion (like the first N calls to the random number generator).

Sort:  

Yes I think this is what I will do. I found a JS random number generator that can be seeded (since Math.random() cannot) here: https://www.npmjs.com/package/seedrandom

Thank you!

Yeah, Javascript's build in random number generator is pretty primitive. The package you found looks like it will do the trick just fine. You just reminded me I keep wanting to play around more with Node.js...just need to make some time.

The transaction hash is already strong random number. Let's take eg. first 3 digits to get an ID of draw card.