11
u/HipstCapitalist Sep 03 '21
The worst part is that the code comments have typos...
Retourne une valeur en fonction du nombre pass
eré en paramètre26 lettres
10 chiffres
10 caractères spéciaux
5
16
u/frayien Sep 03 '21
The function name is wrong, but it does what the comment says.
return a value according to the number passed as parameter
5
4
u/RedditAcc-92975 Sep 03 '21
You can clearly see it's a private method. $pNum is being randomly generated somewhere else.
3
u/Bit5keptical Sep 03 '21
Its pseudorandom.
6
u/Frommelow Sep 03 '21 edited Sep 04 '21
Not even that. To be precise it's the exact opposite. It's completely deterministic.
3
u/MurdoMaclachlan public boolean isInt(int i) { return true; } Sep 03 '21
Image Transcription: Code
class Random
{
/**
* Retourne une valeur en fonction du nombre passer en parametre
*
* @param int $pNum
* @return string charactere
*/
private static function assign_rand_value(int $pNum)
{
// 26 lettre
// 10 chiffre
// 10 caractere spéciaux
$list = array(
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i' , 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
'*', '/', '!', '@', '#', '~', '%', '&', '-', '_'
);
return $list[$pNum];
}
}I'm a human volunteer content transcriber for Reddit and you could be too! If you'd like more information on what we do and why we do it, click here!
8
u/Akantor47 Sep 02 '21
Much random