Solved

hash function wanted

Posted on 2001-06-26
4
207 Views
Last Modified: 2010-04-15
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.
0
Comment
Question by:toTo
4 Comments
 
LVL 3

Expert Comment

by:3rsrichard
ID: 6227787
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??
0
 
LVL 30

Expert Comment

by:Axter
ID: 6229675
Is this homework?
0
 
LVL 6

Accepted Solution

by:
graham_k earned 200 total points
ID: 6230253
http://burtleburtle.net/bob/hash/doobs.html
http://www.cs.technion.ac.il/~biham/Reports/Tiger/

etc, etc, as long as it isn't homwwork. If it is, forget that you read that.

















Actually, if it is homework, best not use these, as your prof will see immediately that the code is far too advanced for you to have written. Of course, if it isn't, just plug the code in & use it.
0
 
LVL 1

Author Comment

by:toTo
ID: 6230361
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.
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
c language help - file paths 7 147
Inorder binary search tree 5 163
Problem to show menu 5 88
Why  my code (program) build with old compiler? 11 42
Preface I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…
Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
The goal of this video is to provide viewers with basic examples to understand opening and writing to files in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use for-loops in the C programming language.

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question