Xorshift and all LFSR type generators will grind to a screeching halt and do nothing if one were to seed it with an all-zeros state. It appears(if there isn't a bug in my test), that the following function:

```
y = one_xorshift_round(y)
y = y ^ key

```

will be resistant to that kind of lockup, because any non-zero state of y will produce a change to some random value, and any state that is zero will be XORed to something else by the key. If the key *causes* it to land on a zero, it will fix it next round.

I would imagine you would also get the added benefit of every "key" value producing a different sequence.

My application is an Arduino library that needs statistically random numbers that do not need to have any cryptographic strength at all, but cannot just repeat the same cycle over and over again. What I want to do is use the current count of microseconds since the board was powered on as the key, which should add a bit of entropy to the RNG every time it is used(due to uncertainties in the exact timing of things caused by user inputs and the like), and also cause the random sequence to be different over time, sortof artificially faking having a larger period.

My question is, is there some value of key, or simple pattern of variable key, that would cause the XORSHIFT generator to do something bad, like enter a short cycle? I'd imagine the math to actually figure it out would be very complicated but maybe someone has a reference to a paper or soomething with a similiarly modified RNG?

Thanks!

Edit, additional info: my first reaction to the issue of the all zeros state was just to add 1 to the state every round, but I found that adding a constant to the state reduced the period by an amount that varied with the constant but did not seem to have any simple pattern.