Solved

hash function wanted

Posted on 2001-06-26
4
215 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

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…
This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
The goal of this video is to provide viewers with basic examples to understand and use pointers 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.

623 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