Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
RAND() not very random
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Divers
Thread ID:
01155607
Message ID:
01157317
Vues:
97
An interisting tidbit from http://fox.wikis.com/wc.dll?Wiki~HelloWorld~VFP
demonstrates how random it is.

? CHR(INT(RAND(37769.1)*26+65))+;
CHR(INT(RAND()*26+65))+;
CHR(INT(RAND()*26+65))+;
CHR(INT(RAND()*26+65))+;
CHR(INT(RAND()*26+65))+;
" "+ ;
CHR(INT(RAND(1612256)*26+65))+ ;
CHR(INT(RAND()*26+65))+ ;
CHR(INT(RAND()*26+65))+ ;
CHR(INT(RAND()*26+65))+ ;
CHR(INT(RAND()*26+65))



>Hi, Terry/All,
>
>I was just wonder how random is VFP's random number generator?
>I'm sure it's a pseudo-random-number generator, but to what
>degree? Besides the initial seed, can we feed the thing a seed
>array for better entropy? I'm kinda wondering what's the period
>of the generator? What I'm getting at is this: How secure is
>the generator, and would anyone say it's good enough for encryption
>purposes?
>
>Randall
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform