Link to home
Start Free TrialLog in
Avatar of toTo
toTo

asked on

hash function wanted

In order to index an adress book, i am looking for a simple hash function.
Say take a 48 byte names and make 4 bytes digest.
Avatar of 3rsrichard
3rsrichard

char input[48];
char output[4];
int i;

for (i=0; i<48; i+=4){
output[0] ^= input[i];
output[1]^=input[i+1];
output[2]^=input[i+2];
output[3]"=input[i+3];
};

or did you want something fancier??
Avatar of Axter
Is this homework?
ASKER CERTIFIED SOLUTION
Avatar of graham_k
graham_k

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of toTo

ASKER

Thank you to provides those URLs
I could not find them on search engins.
Thanks to 3rsrichard, too bad it is not homework, his answer would have been a good start.