def encode(self, key):
salt = self.salt or os.urandom(<NUM_LIT:32>).encode('<STR_LIT>').rstrip()<EOL>return self.encode_w_salt(salt, key)<EOL>
Encodes a user key into a particular format. The result of this method
        will be used by swauth for storing user credentials.

        If salt is not manually set in conf file, a random salt will be
        generated and used.

        :param key: User's secret key
        :returns: A string representing user credentials