The solution presented below is possibly the simplest. It is not
the only solution, but it perhaps demands the least mental
effort from the magicians. In any group of five cards, there
must be at least two of the same suit. A selects one of the
cards from a duplicate suit and hands it back to the audience
member. The other card (or one of the others, if there is more
than one) is placed first in the set of four, and will indicate
the suit. Next, think of the remaining three cards as Low,
Medium, and High values (their actual values don't matter.) Any
pre-agreed order will suffice; for example, ascending face value
(Ace to King), with the suit used as a tie-breaker, if
necessary. We could use an alphabetical suit order: Clubs,
Diamonds, Hearts, Spades. So, for example, 3S would come before
7C; and, using the tie-breaker, 7C would come before 7H. Hence
the Low-Medium-High ordering in this case would be: 3S, 7C, 7H.
Given Low, Medium, and High, we can encode a number between one
and six as follows: LMH = 1, LHM