Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I'm unsure if there's a library which can match your purpose. I can give you some pointers on the implementation though:</p> <p>The basis of your implementation will be a LFSR. You can implement one in two ways:</p> <ul> <li>The Fibonacci implementation consists of a simple shift register in which a modulo-2 sum of the binary-weighted taps is fed back to the input (remember that mod-2 sum is equivalent to addition without carry, which is in turn equivalent with XOR).</li> <li>The Galois implementation consists of a shift register, the content of which is modified at every step by a binary-weighted value of the output stage, again using modulo-2 math. The order of the Galois weights is opposite that of the Fibonacci weights. The Galois form is generally faster due to the reduced amount of logic in the feedback loop.</li> </ul> <p>For more information on how taps are specified and what sequences you can obtain you can start <a href="http://www.newwaveinstruments.com/resources/articles/m_sequence_linear_feedback_shift_register_lfsr.htm" rel="nofollow noreferrer">here</a>. Note that your implementation choices above can have the same cycle length and sequence of output bits for an appropriate choice of initial states (seeds).</p> <p>That's your basic requirement right there. LFSRs have output streams that are very uniformly distributed and sufficiently long periods. I'd suggest not to use it for cryptographic purposes, as it's extremely weak - being a linear system. There are workarounds, but nothing substantial except the <a href="http://en.wikipedia.org/wiki/Shrinking_generator" rel="nofollow noreferrer">shrinking generator</a> (which I find extremely cool).</p> <p>Links to implementations have already been given, so good luck!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload