diff options
Diffstat (limited to 'src/card.py')
-rw-r--r-- | src/card.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/card.py b/src/card.py index c4f7541..9f888e6 100644 --- a/src/card.py +++ b/src/card.py @@ -5,6 +5,9 @@ Defines a struct representing a single card. The struct takes the form: """ 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) |