code: def encode_w_salt(self, salt, key):
          
          enc_key = '%s%s' % (salt, key)
          enc_val = hashlib.sha1(enc_key).hexdigest()
          return "sha1:%s$%s" % (salt, enc_val)
docs: Encodes a user key with salt into a particular format. The result of
          this method will be used internally.
  
          :param salt: Salt for hashing
          :param key: User's secret key
          :returns: A string representing user credentials