Hello,

also hash key randomness can be influenced (I don mean this is a wise thing to do..) by ENV vars, specifically PERL_PERTURB_KEYS and PERL_HASH_SEED

perl -v This is perl 5, version 26, subversion 0 (v5.26.0) built for MSWin32-x +64-multi-thread perl -wMstrict -le "for (1 .. 8) {my @k = keys %{ { map { $_ => 1 } 0 +.. 8 } };print qq{@k};}" 2 8 5 3 0 1 4 6 7 2 0 8 5 3 1 6 4 7 2 4 7 6 1 3 8 5 0 1 4 7 6 0 8 5 3 2 2 0 8 5 3 1 7 6 4 4 7 6 1 3 5 8 0 2 3 8 5 0 6 4 7 1 2 0 5 8 3 1 6 4 7 2 set PERL_PERTURB_KEYS=0 set PERL_HASH_SEED=0x0 perl -wMstrict -le "for (1 .. 8) {my @k = keys %{ { map { $_ => 1 } 0 +.. 8 } };print qq{@k};}" 6 7 5 2 3 1 0 8 4 6 7 5 2 3 1 0 8 4 6 7 5 2 3 1 0 8 4 6 7 5 2 3 1 0 8 4 6 7 5 2 3 1 0 8 4 6 7 5 2 3 1 0 8 4 6 7 5 2 3 1 0 8 4 6 7 5 2 3 1 0 8 4 set PERL_PERTURB_KEYS= set PERL_HASH_SEED= perl -wMstrict -le "for (1 .. 8) {my @k = keys %{ { map { $_ => 1 } 0 +.. 8 } };print qq{@k};}" 2 8 4 1 6 0 3 5 7 3 5 7 8 2 4 1 6 0 5 3 7 4 1 2 8 0 6 4 1 2 8 0 6 5 3 7 7 3 5 6 0 2 8 4 1 5 3 7 1 4 2 8 0 6 7 5 3 0 6 4 1 8 2 7 3 5 6 0 8 2 1 4

see also PERL_HASH_SEED and PERL_PERTURB_KEYS both on perlrun and Algorithmic-Complexity-Attacks and order of hash and setting PERL_PERTURB_KEYS & PERL_HASH_SEED in a perl file

L*

There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.

In reply to Re^6: Pick k numbers at random -- hash keys (randomness) by Discipulus
in thread Pick k numbers at random by Chuma

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.