$search
00001 #ifndef CASTOR_HASHCODE_H 00002 #define CASTOR_HASHCODE_H 1 00003 00004 #include "stdlib.h" 00005 #include "NetAddress.h" 00006 00007 namespace castor { 00008 00009 class Hashcode { 00010 00011 protected: 00012 00013 static void mix(unsigned int *a, unsigned int *b, unsigned int *c); 00014 00015 public: 00016 00017 static unsigned int compute(const unsigned char *data, size_t len); 00018 }; 00019 00020 00021 int hashcode(bool x); 00022 int hashcode(char x); 00023 int hashcode(unsigned char x); 00024 int hashcode(short x); 00025 int hashcode(unsigned short x); 00026 int hashcode(long x); 00027 int hashcode(unsigned long x); 00028 int hashcode(long long x); 00029 int hashcode(unsigned long long x); 00030 int hashcode(float x); 00031 int hashcode(double x); 00032 int hashcode(const std::string x); 00033 int hashcode(const castor::net::NetAddress &a); 00034 00035 } 00036 00037 #endif /* CASTOR_HASHCODE_H */ 00038