¡@

Home 

php Programming Glossary: lcg

PHP short unique ID generation using auto_increment?

http://stackoverflow.com/questions/1650185/php-short-unique-id-generation-using-auto-increment

An easier way would to use a linear congruential generator LCG which is usually used for generating random numbers which is.. a linearly increasing index and use the next value in the LCG sequence as your secret key. EDIT2 Implementation You can design.. secret key. EDIT2 Implementation You can design your own LCG parameters but if you get it wrong it won't cover the full range..

What's the disadvantage of mt_rand?

http://stackoverflow.com/questions/7808021/whats-the-disadvantage-of-mt-rand

Mersenne Twister algorithm which is far better than the LCG typically used by rand . For example the period of an LCG is.. LCG typically used by rand . For example the period of an LCG is a measly 2 32 whereas the period of mt_rand is 2 19937 1... mt_rand is 2 19937 1. Also all the values generated by an LCG will lie on lines or planes when plotted into a multidemensional..