- Timestamp:
- 08/26/14 18:37:44 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/bletchley/chosenct.py
r65 r71 75 75 76 76 def _generate_colors(self, s): 77 if isinstance(s, str): 78 s = s.encode('utf-8') 77 79 base=bytes(hashlib.md5(s).digest()[0:6]) 78 80 color1 = "#%.2X%.2X%.2X" % tuple(base[:3]) … … 96 98 message = self._raw_table[offset][v] 97 99 bg,fg = self._generate_colors(message) 98 message = message.decode('utf-8') 100 if not isinstance(message, str): 101 message = message.decode('utf-8') 99 102 100 103 truncated = message[0:maxlen]
Note: See TracChangeset
for help on using the changeset viewer.