'Build the contents of the X-NFSN-Authentication HTTP header. See
https://members.nearlyfreespeech.net/wiki/API/Introduction for
more explanation.'

def _header(self, action, data):

    login = self.user_id
    timestamp = self._timestamp()
    salt = self._salt()
    api_key = self.key
    data = urlencode(data)
    data_hash = hashlib.sha1(data.encode('utf-8')).hexdigest()
    string = ';'.join((login, timestamp, salt, api_key, action, data_hash))
    string_hash = hashlib.sha1(string.encode('utf-8')).hexdigest()
    return ';'.join((login, timestamp, salt, string_hash))
