code: def encode(self, key):
          
          salt = self.salt or os.urandom(32).encode('base64').rstrip()
          return self.encode_w_salt(salt, key)
docs: 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