""" Defines a struct representing a single card. The struct takes the form: (front, back) """ from collections import namedtuple from hashlib import md5 Card = namedtuple('Card', ['front', 'back']) def getId(card: Card) -> int: return int(md5((card.front + card.back).encode("utf-8")).hexdigest(), 16)