Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The "char" type might be signed, both hash functions are defined to w… #15

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

gene-hightower
Copy link

…ork on unsigned 8-bit values.

Description:

For example, DJB's C code for this hash function is:

uint32 cdb_hash(buf,len)
unsigned char *buf;
unsigned int len;
{
uint32 h;

h = 5381;
while (len) {
--len;
h += (h << 5);
h ^= (uint32) *buf++;
}
return h;
}

This code uses + in place of ^, but that I think is a choice and not just an oversight.

Steps to test this PR:
1.
1.


Internal references:

Software Engineering Expectations
Technical Design Template

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant