]> git.parisson.com Git - teleforma.git/commitdiff
generate hash with utf8 based encoder
authorGuillaume Pellerin <guillaume.pellerin@parisson.com>
Thu, 27 Jun 2024 08:24:47 +0000 (10:24 +0200)
committerGuillaume Pellerin <guillaume.pellerin@parisson.com>
Thu, 27 Jun 2024 08:24:47 +0000 (10:24 +0200)
teleforma/utils.py

index c26835d8f3152eaefdface0a3d26bcefeddf6351..b6982744aaf1c9ddd270f9122d453ff9c111a416 100644 (file)
@@ -12,5 +12,5 @@ def generate_hash(mid):
     """
     mid = "%x" % mid
     msg = '%s-%s' % (settings.SECRET_KEY, mid)
-    md5 = hashlib.md5(msg.encode('ascii')).hexdigest()
+    md5 = hashlib.md5(msg.encode('utf8')).hexdigest()
     return '%s%s' % (mid, md5[:4])