dimanche 26 juillet 2020

PHP's str_shuffle function internals

Basically I'm looking for the internals of the str_shuffle function, I want to know how does PHP randomizes the string. Does it use rand() , mt_rand() and how it is seeded, I'm pretty sure it uses the Fisher-Yates algorithm.

The best I would hope for is its complete C equivalent. (PHP is written in C), but I can't find anything on the matter, the documentation is pretty light and superficial.

What I ultimately what to know is, suppose I have something like str_shuffle('whatever'), how could I predict its output? since str_shuffle is said to not be cryptographically secure, but I couldn't find any security issues or complaints against str_shuffle. Thanks




Aucun commentaire:

Enregistrer un commentaire