Solved

hash function wanted

Posted on 2001-06-26
4
204 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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

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…
Summary: This tutorial covers some basics of pointer, pointer arithmetic and function pointer. What is a pointer: A pointer is a variable which holds an address. This address might be address of another variable/address of devices/address of fu…
The goal of this video is to provide viewers with basic examples to understand and use structures in the C programming language.
The goal of this video is to provide viewers with basic examples to understand how to create, access, and change arrays in the C programming language.

708 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now