I have a 16 byte md5 hash that I need to "fold" into 4-byte data using XOR: {1st 4 bytes} XOR {2nd 4 bytes} XOR {3rd 4 bytes} XOR {4th 4 bytes}. I then need to convert the result to Hex form (8 char string).
I'm generating my hash like this (decoding to hex as it seems like it'll be easier to deal with):
SELECT decode(md5('test'), 'hex');
But that's as far as I got. I don't know the best way split the 16 byte hash into 4, 4-byte values, then XOR those 4-byte values.