def _encode(self, k):
        """
        Encode a key so it can be used as a filename.
        """
        # NOTE: '_' is NOT in the base64 alphabet!
        return base64.encodestring(k).replace(b'\n', b'_').replace(b"/", b"-")

        Encode a key so it can be used as a filename.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/persisted/dirdbm.py