Race, class, and diety are bitwise expressions. Someone else will have to give you the code, but here is an example.
THIS IS NOT THE REAL VALUES, just an example for 4 races.
decimal 4 is 0100 in binary
if the races were human halfelf highelf and woodelf
reading right to left:
first digit 0 is for humans
second digit 0 is for woodelf
third digit 1 is for half elf - wearable
forth digit 0 is for highelf
73 in binary is 1001001 the 3 1's represent your 3 races that can wear it. Not sure which is which though.
Oh, wait Stormgod's EQ treasures web stuff should have what you need in it....
http://www.stormgod-online.com/