argosofithica / xorshift-brute-force Goto Github PK
View Code? Open in Web Editor NEWA simple Python script for brute-forcing all valid triples for a xorshift prng of some arbitrary word size
License: MIT License
A simple Python script for brute-forcing all valid triples for a xorshift prng of some arbitrary word size
License: MIT License
Nice program, I can really use it as Iwant an XORSHIFT algorithm for any n, not just 8 or 16.
Just a small suggestion:
You could optimize it by simply stopping the loop in xor_shift_period as soon as a value is seen twice (testing for result[x] = 1), speeding up the program by at least a factor of 2 (or more? Haven't really done the math).
Oh, and you are testing 0 values for a, b and c which are not a possible result.
BTW here is my Java version and a table of working triplets up to word size 31. BTW I am allowing 0 in a triplet to indicate skipping one of the right xorshifts. This way we get faster RNGs, and we can include 1 and 2 bits.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.