Skip to content

Commit

Permalink
📝 Give simple seed computation example (#562)
Browse files Browse the repository at this point in the history
  • Loading branch information
dubzzz committed Mar 12, 2023
1 parent e432d59 commit ffacfbd
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,14 @@ const rand = (min, max) => {
const firstDiceValue = rand(1, 6); // value in {1..6}, here: 6
```

**Select your seed**

While not perfect, here is a rather simple way to generate a seed for your PNRG.

```javascript
const seed = Date.now() ^ (Math.random() * 0x100000000)
```

## Documentation

### Pseudorandom number generators
Expand Down

0 comments on commit ffacfbd

Please sign in to comment.