chiark
/
gitweb
/
~mdw
/
catacomb-python
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
mp.c: Factor out and export `mphash'.
[catacomb-python]
/
catacomb
/
pwsafe.py
diff --git
a/catacomb/pwsafe.py
b/catacomb/pwsafe.py
index cfbac7ed8e8081ff01707526dcf6a1040e8406af..03ed6852c9c98e9c2044caac6f5e49545fceb925 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')