C++ (Qt)uint32 hash( const char * str ){ if (!str) return 0; uint32 val = 0; char * dst = (char *) &val; size_t i = 0; while (*str) { dst[i] ^= *str; ++str; i = (i + 1) % sizeof(val); } return val;}