mirror of
https://git.openafs.org/openafs.git
synced 2025-01-18 15:00:12 +00:00
opr: Make opr_jhash_opaque consistent with opr_jhash
Change-Id: I42e1030f8c841dcb974476012a774b91c87d3fb0 Reviewed-on: https://gerrit.openafs.org/12494 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Michael Meffie <mmeffie@sinenomine.net> Tested-by: Michael Meffie <mmeffie@sinenomine.net> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
This commit is contained in:
parent
958120b89d
commit
5151c03351
@ -125,7 +125,7 @@ opr_jhash_opaque(const void *val, size_t length, afs_uint32 initval)
|
||||
afs_uint32 a,b,c;
|
||||
|
||||
/* Set up the internal state */
|
||||
a = b = c = 0xdeadbeef + (((afs_uint32)length)<<2) + initval;
|
||||
a = b = c = 0xdeadbeef + ((afs_uint32)length) + initval;
|
||||
|
||||
while (length > 12) {
|
||||
a += (afs_uint32) str[3]<<24 |
|
||||
|
@ -65,10 +65,10 @@ main(int argc, char **argv)
|
||||
is_int(0xdeadbeef, opr_jhash_opaque("", 0, 0),
|
||||
"Hashing an empty string works");
|
||||
|
||||
is_int(2748273291UL,
|
||||
is_int(393676113,
|
||||
opr_jhash_opaque("Four score and seven years ago", 30, 0),
|
||||
"Hashing a string with a 0 initval works");
|
||||
is_int(1389900913,
|
||||
is_int(3445784929UL,
|
||||
opr_jhash_opaque("Four score and seven years ago", 30, 1),
|
||||
"Hashing a string with a 1 initval works");
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user