summaryrefslogtreecommitdiff
path: root/systems/texlive/tlnet/tlpkg/tlperl/lib/Hash
diff options
context:
space:
mode:
Diffstat (limited to 'systems/texlive/tlnet/tlpkg/tlperl/lib/Hash')
-rw-r--r--systems/texlive/tlnet/tlpkg/tlperl/lib/Hash/Util.pm34
-rw-r--r--systems/texlive/tlnet/tlpkg/tlperl/lib/Hash/Util/FieldHash.pm9
2 files changed, 27 insertions, 16 deletions
diff --git a/systems/texlive/tlnet/tlpkg/tlperl/lib/Hash/Util.pm b/systems/texlive/tlnet/tlpkg/tlperl/lib/Hash/Util.pm
index 5a3e626be8..a0da8ba1b0 100644
--- a/systems/texlive/tlnet/tlpkg/tlperl/lib/Hash/Util.pm
+++ b/systems/texlive/tlnet/tlpkg/tlperl/lib/Hash/Util.pm
@@ -6,10 +6,10 @@ use Carp;
use warnings;
no warnings 'uninitialized';
use warnings::register;
-use Scalar::Util qw(reftype);
+no warnings 'experimental::builtin';
+use builtin qw(reftype);
require Exporter;
-our @ISA = qw(Exporter);
our @EXPORT_OK = qw(
fieldhash fieldhashes
@@ -42,7 +42,7 @@ our @EXPORT_OK = qw(
BEGIN {
# make sure all our XS routines are available early so their prototypes
# are correctly applied in the following code.
- our $VERSION = '0.25';
+ our $VERSION = '0.30';
require XSLoader;
XSLoader::load();
}
@@ -92,7 +92,7 @@ Hash::Util - A selection of general-utility hash subroutines
hash_traversal_mask
);
- %hash = (foo => 42, bar => 23);
+ my %hash = (foo => 42, bar => 23);
# Ways to restrict a hash
lock_keys(%hash);
lock_keys(%hash, @keyset);
@@ -510,13 +510,22 @@ Perl has been built with. Possible sizes may be but are not limited to
=item B<hash_value>
my $hash_value = hash_value($string);
-
-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
-in. This value is only reliable for the lifetime of the process. It may
-be different depending on invocation, environment variables, perl version,
+ my $hash_value = hash_value($string, $seed);
+
+C<hash_value($string)>
+returns
+the current perl's internal hash value for a given string.
+C<hash_value($string, $seed)>
+returns the hash value as if computed with a different seed.
+If the custom seed is too short, the function errors out.
+The minimum length of the seed is implementation-dependent.
+
+Returns a 32-bit integer
+representing the hash value of the string passed in.
+The 1-parameter value is only reliable
+for the lifetime of the process.
+It may be different
+depending on invocation, environment variables, perl version,
architectures, and build options.
B<Note that the hash value of a given string is sensitive information>:
@@ -833,6 +842,9 @@ hv_store() is from Array::RefElem, Copyright 2000 Gisle Aas.
Additional code by Yves Orton.
+Description of C<hash_value($string, $seed)>
+by Christopher Yeleighton <ne01026@shark.2a.pl>
+
=head1 SEE ALSO
L<Scalar::Util>, L<List::Util> and L<perlsec/"Algorithmic Complexity Attacks">.
diff --git a/systems/texlive/tlnet/tlpkg/tlperl/lib/Hash/Util/FieldHash.pm b/systems/texlive/tlnet/tlpkg/tlperl/lib/Hash/Util/FieldHash.pm
index 06343ae80a..f010b2d03c 100644
--- a/systems/texlive/tlnet/tlpkg/tlperl/lib/Hash/Util/FieldHash.pm
+++ b/systems/texlive/tlnet/tlpkg/tlperl/lib/Hash/Util/FieldHash.pm
@@ -1,14 +1,13 @@
package Hash::Util::FieldHash;
-use 5.009004;
use strict;
use warnings;
-use Scalar::Util qw( reftype);
+no warnings 'experimental::builtin';
+use builtin qw(reftype);
-our $VERSION = '1.21';
+our $VERSION = '1.26';
-require Exporter;
-our @ISA = qw(Exporter);
+use Exporter 'import';
our %EXPORT_TAGS = (
'all' => [ qw(
fieldhash