summaryrefslogtreecommitdiffstats
path: root/src/card.py
blob: c2243a6c579abf99f5a9e0c76f6a34db7e96c0a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
"""
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) -> str:
    return md5((card.front + card.back).encode("utf-8")).hexdigest()