Message ID hash and compare functions