Bug 39604 - apr_memcache_hash not returning expected result
Summary: apr_memcache_hash not returning expected result
Status: RESOLVED FIXED
Alias: None
Product: APR
Classification: Unclassified
Component: APR-util (show other bugs)
Version: HEAD
Hardware: All other
: P2 normal (vote)
Target Milestone: ---
Assignee: Apache Portable Runtime bugs mailinglist
URL:
Keywords: PatchAvailable
Depends on:
Blocks:
 
Reported: 2006-05-17 23:38 UTC by Matthew Kent
Modified: 2007-06-07 23:19 UTC (History)
0 users



Attachments
proposed fix (686 bytes, patch)
2006-05-17 23:38 UTC, Matthew Kent
Details | Diff
much simpler ;) (686 bytes, patch)
2006-05-18 15:21 UTC, Matthew Kent
Details | Diff
guess the patch needs a new filename (399 bytes, patch)
2006-05-18 15:23 UTC, Matthew Kent
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Matthew Kent 2006-05-17 23:38:03 UTC
According to the docs, unless I'm missing something here, apr_memcache_hash is
supposed to '@return crc32 hash of data' which is doesn't presently. 

A crc32 of "78c49fb72eff59e4228487986eab8d02" produces 17349 versus the expected
result of 3284505574.

Attached patch corrects the problem.
Comment 1 Matthew Kent 2006-05-17 23:38:53 UTC
Created attachment 18309 [details]
proposed fix
Comment 2 Matthew Kent 2006-05-18 15:19:59 UTC
Comment on attachment 18309 [details]
proposed fix

er.. this is really just a one liner
Comment 3 Matthew Kent 2006-05-18 15:21:08 UTC
Created attachment 18316 [details]
much simpler ;)
Comment 4 Matthew Kent 2006-05-18 15:23:23 UTC
Created attachment 18317 [details]
guess the patch needs a new filename
Comment 5 William A. Rowe Jr. 2006-09-19 19:54:32 UTC
Mass reassign the 44 open apr-bugs to apr bug list
Comment 6 Paul Querna 2007-06-07 23:19:16 UTC
While apr_memcache_hash was not returning an actual CRC32 -- a raw CRC32 is not
what other memcache clients used.

This has been clarified in trunk, and it is now possible to configure your own
hash function, or to force it to use pure CRC32, by setting the mc->hash_func
callback.