develooper Front page | perl.perl5.porters | Postings from December 2012

Re: [perl.git] branch blead, updated. v5.17.7.0-108-g77a9214

From:
demerphq
Date:
December 28, 2012 14:44
Subject:
Re: [perl.git] branch blead, updated. v5.17.7.0-108-g77a9214
Message ID:
CANgJU+UP7njySwTDxHorCkHud96Dn7ATe_M1O4nqEdicj9R-Ug@mail.gmail.com
On 26 December 2012 01:50, James Keenan <jkeen@verizon.net> wrote:
> In perl.git, the branch blead has been updated
>
> <http://perl5.git.perl.org/perl.git/commitdiff/77a9214240d18319141bf575acd42fdf4ca3d9c7?hp=8d40577bdbdfa85ed3293f84bf26a313b1b92f55>
>
> - Log -----------------------------------------------------------------
> commit 77a9214240d18319141bf575acd42fdf4ca3d9c7
> Author: reneeb <github@renee-baecker.de>
> Date:   Wed Dec 26 00:06:02 2012 +0100
>
>     Add new functions of Hash::Util in documentation.
>
>     Add call of 'hash_value' to synopsis and fix typo.
>     Typographical and grammatical touch-ups (by committer).
> -----------------------------------------------------------------------
>
> Summary of changes:
>  ext/Hash-Util/lib/Hash/Util.pm |   25 ++++++++++++++-----------
>  1 files changed, 14 insertions(+), 11 deletions(-)
>
> diff --git a/ext/Hash-Util/lib/Hash/Util.pm b/ext/Hash-Util/lib/Hash/Util.pm
> index 20a730e..864d1d6 100644
> --- a/ext/Hash-Util/lib/Hash/Util.pm
> +++ b/ext/Hash-Util/lib/Hash/Util.pm
> @@ -28,8 +28,8 @@ our @EXPORT_OK  = qw(
>                       lock_ref_keys_plus
>                       hidden_ref_keys legal_ref_keys
>
> -                     hash_seed hash_value bucket_stats bucket_info bucket_array
> -                     hv_store
> +                     hash_seed hash_value hv_store
> +                     bucket_stats bucket_info bucket_array
>                       lock_hash_recurse unlock_hash_recurse
>                      );
>  our $VERSION = '0.13';
> @@ -73,7 +73,8 @@ Hash::Util - A selection of general-utility hash subroutines
>                       lock_ref_keys_plus
>                       hidden_ref_keys legal_ref_keys
>
> -                     hash_seed hv_store
> +                     hash_seed hash_value hv_store
> +                     bucket_stats bucket_info bucket_array
>                       lock_hash_recurse unlock_hash_recurse
>                     );
>
> @@ -102,6 +103,8 @@ Hash::Util - A selection of general-utility hash subroutines
>
>    my $hashes_are_randomised = hash_seed() != 0;
>
> +  my $int_hash_value = hash_value( 'string' );
> +
>  =head1 DESCRIPTION
>
>  C<Hash::Util> and C<Hash::Util::FieldHash> contain special functions
> @@ -206,7 +209,7 @@ Returns a reference to %hash
>
>
>  sub lock_ref_keys_plus {
> -    my ($hash,@keys)=@_;
> +    my ($hash,@keys) = @_;
>      my @delete;
>      Internals::hv_clear_placeholders(%$hash);
>      foreach my $key (@keys) {
> @@ -477,7 +480,7 @@ Perl has been built with. Possible sizes may be but are not limited to
>
>      my $hash_value = hash_value($string);
>
> -hash_value() returns the current perls internal hash value for a given
> +hash_value() returns the current perl's internal hash value for a given
>  string.
>
>  Returns a 32 bit integer representing the hash value of the string passed
> @@ -496,7 +499,7 @@ know it. See also L<perlrun/PERL_HASH_SEED_DEBUG>.
>
>  Return a set of basic information about a hash.
>
> -    my ($keys, $buckets, $used, @length_counts)= bucket_info($hash);
> +    my ($keys, $buckets, $used, @length_counts) = bucket_info($hash);
>
>  Fields are as follows:
>
> @@ -513,7 +516,7 @@ See also bucket_stats() and bucket_array().
>  Returns a list of statistics about a hash.
>
>      my ($keys, buckets, $used, $utilization_ratio, $collision_pct,
> -        $mean, $stddev, @length_counts)= bucket_info($hashref);
> +        $mean, $stddev, @length_counts) = bucket_info($hashref);
>
>
>  Fields are as follows:
> @@ -540,10 +543,10 @@ of the array is either an integer K, in which case it represents K empty buckets
>  a reference to another array which contains the keys that are in that bucket.
>
>  B<Note that the information returned by bucket_array is sensitive information>:
> -by knowing it one can directly attack perls hash function which in turn may allow
> +by knowing it one can directly attack perl's hash function which in turn may allow
>  one to craft a denial-of-service attack against Perl code, even remotely,
>  see L<perlsec/"Algorithmic Complexity Attacks"> for more information.
> -B<Do not disclose the outputof this function> to people who don't need to
> +B<Do not disclose the output of this function> to people who don't need to
>  know it. See also L<perlrun/PERL_HASH_SEED_DEBUG>. This function is provided strictly
>  for  debugging and diagnostics purposes only, it is hard to imagine a reason why it
>  would be used in production code.
> @@ -552,8 +555,8 @@ would be used in production code.
>
>
>  sub bucket_stats {
> -    my ($hash)= @_;
> -    my ($keys, $buckets, $used, @length_counts)= bucket_info($hash);
> +    my ($hash) = @_;
> +    my ($keys, $buckets, $used, @length_counts) = bucket_info($hash);


FWIW I do this deliberately to denote assignment. Also I thought we
dont do WS/Style changes as a general rule?

Patches like this make merging real code changes a lot harder, and I
have patches to this code in a topic branch currently that I plan to
return to, so this patch is going to result in me doing a lot of
conflict resolution. I don't think it is worth it.

Cheers,
Yves

-- 
perl -Mre=debug -e "/just|another|perl|hacker/"



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About