Calculates the entropy of a message