equal
deleted
inserted
replaced
24 from Crypto.Cipher import Blowfish |
24 from Crypto.Cipher import Blowfish |
25 |
25 |
26 |
26 |
27 _CYPHERERS = {} |
27 _CYPHERERS = {} |
28 def _cypherer(seed): |
28 def _cypherer(seed): |
|
29 if isinstance(seed, str): |
|
30 seed = seed.encode('utf-8') |
29 try: |
31 try: |
30 return _CYPHERERS[seed] |
32 return _CYPHERERS[seed] |
31 except KeyError: |
33 except KeyError: |
32 _CYPHERERS[seed] = Blowfish.new(seed, Blowfish.MODE_ECB) |
34 _CYPHERERS[seed] = Blowfish.new(seed, Blowfish.MODE_ECB) |
33 return _CYPHERERS[seed] |
35 return _CYPHERERS[seed] |