If either id is uninitialized (empty) compare on name, otherwise on id
Turn into hash used by associative arrays. Note that in rare cases (i.e. where one tag is id is initialized and the other isn't this can lead to different hashes even though opEquals returns equal.