Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

Ever wonder exactly which keys in your particular hash are sharing a bucket? Here is a destructive tool that will tell you that:

my %hash= 0..299; for my $av ( getKeyCollisions( \%hash ) ) { print "@$av\n"; } sub getKeyCollisions { my( $hv )= @_; no warnings 'numeric'; my $buckets= 0 + %$hv; my @keys= keys %$hv; my( @clash, @return ); while( @keys ) { my $key= shift @keys; delete $hv->{$key}; my $b= 0 + %$hv; if( $b == $buckets ) { push @clash, $key; } elsif( @clash ) { push @return, [@clash,$key]; @clash= (); } $buckets= $b; } return @return; } __END__ 276 90 206 118 272 190 298 194 226 58 284 86 76 82 110 280 228 268 218 202 168 184 14 178 24 104 124 256 216 26 80 72 162 74 240 246 108 230 64 210 68 188 116 88 136 30 144 286 120 28 40 134 156 192 250 22 42 158 94 248 296 34 132 164

- tye        


In reply to Re^4: Hashes aren't being differently randomized (colliders) by tye
in thread Hashes aren't being differently randomized by Hue-Bond

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (5)
As of 2024-04-26 07:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found