This problem sounds simple at first glance, but turns out to be a lot more complicated than it seems. It\'s got me stumped for the moment.
There are 52c5 = 2,598,960
You could simply give all hands a canonical ordering of values (A to K), then assign abstract suit letters according to their order of first appearance in that order.
Example: JH 4C QD 9C 3D would convert to 3a 4b 9b Jc Qa.
Generation should work best as dynamic programming: