Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

hash function wanted

Posted on 2001-06-26
4
Medium Priority
?
218 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 800 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control.  For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…
This tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use switch statements in the C programming language.

916 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