chiark
/
gitweb
/
~mdw
/
catacomb-python
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
*.py: Use `str.replace' rather than `str.translate'.
[catacomb-python]
/
catacomb
/
pwsafe.py
diff --git
a/catacomb/pwsafe.py
b/catacomb/pwsafe.py
index 4b4b99494eef210f344378e4bb7e5f88b6f4fd45..f3af1b93668e2a407df3897c1ffe0acc0f337f07 100644
(file)
--- a/
catacomb/pwsafe.py
+++ b/
catacomb/pwsafe.py
@@
-80,7
+80,7
@@
def _dec_metaname(name):
def _b64(s):
"""Encode S as base64, without newlines, and trimming `=' padding."""
def _b64(s):
"""Encode S as base64, without newlines, and trimming `=' padding."""
- return s.encode('base64').
translate(None, '\n
=')
+ return s.encode('base64').
replace('\n', '').rstrip('
=')
def _unb64(s):
"""Decode S as base64 with trimmed `=' padding."""
return (s + '='*((4 - len(s))%4)).decode('base64')
def _unb64(s):
"""Decode S as base64 with trimmed `=' padding."""
return (s + '='*((4 - len(s))%4)).decode('base64')