23 void hash_xor_init() {
26 uint32_t hash_xor_buffer(uint8_t * buffer, uint16_t length)
29 int limit = (length / 4) * 4;
32 for( i=0; i < limit; i = i + 4) {
33 uint32_t * value = (uint32_t* ) &buffer[i];
37 if( limit < length ) {
38 uint32_t remainder = 0;
39 memcpy(&remainder, &buffer[limit], length - limit);
46 uint32_t hash_xor_convenience(uint32_t one, uint32_t two, uint32_t three, uint32_t four, uint32_t five)
50 memcpy(buffer + 0, &one,
sizeof(uint32_t));
51 memcpy(buffer + 4, &two,
sizeof(uint32_t));
52 memcpy(buffer + 8, &three,
sizeof(uint32_t));
53 memcpy(buffer + 12, &four,
sizeof(uint32_t));
54 memcpy(buffer + 16, &five,
sizeof(uint32_t));
56 return hash_xor_buffer(buffer, 16);
59 uint32_t hash_xor_convenience_ptr(uint32_t * one, uint32_t * two, uint32_t * three, uint32_t * four, uint32_t * five)
63 memcpy(buffer + 0, one,
sizeof(uint32_t));
64 memcpy(buffer + 4, two,
sizeof(uint32_t));
65 memcpy(buffer + 8, three,
sizeof(uint32_t));
66 memcpy(buffer + 12, four,
sizeof(uint32_t));
67 memcpy(buffer + 16, five,
sizeof(uint32_t));
69 return hash_xor_buffer(buffer, 16);
76 hash_xor_convenience_ptr,