# Path: netvisor/_compat.py
# PY2 = sys.version_info[0] == 2


import datetime
import hashlib
import uuid
from requests.auth import AuthBase
from ._compat import text_type
            >>> NetvisorAuth.make_timestamp()
            2008-07-24 15:49:12.221

        """
        now = datetime.datetime.utcnow()
        return now.isoformat(' ')[:-3]

    def make_mac(self, url, timestamp, transaction_id):
        """
        Make a MAC code to authenticate a Netvisor API request.

        :param url:
            the URL where the request is sent to
        :param timestamp:
            a timestamp returned by :meth:`make_timestamp`
        :param transaction_id:
            a unique identifier returned by :meth:`make_transaction_id`
        """
        parameters = [
            url,
            self.sender,
            self.customer_id,
            timestamp,
            self.language,
            self.organization_id,
            transaction_id,
            self.customer_key,
            self.partner_key,
        ]
        joined_parameters = b'&'.join(

# Path: netvisor/_compat.py
# PY2 = sys.version_info[0] == 2


# Path: netvisor/auth.py
import datetime
import hashlib
import uuid
from requests.auth import AuthBase
from ._compat import text_type

            >>> NetvisorAuth.make_timestamp()
            2008-07-24 15:49:12.221

        """
        now = datetime.datetime.utcnow()
        return now.isoformat(' ')[:-3]

    def make_mac(self, url, timestamp, transaction_id):
        """
        Make a MAC code to authenticate a Netvisor API request.

        :param url:
            the URL where the request is sent to
        :param timestamp:
            a timestamp returned by :meth:`make_timestamp`
        :param transaction_id:
            a unique identifier returned by :meth:`make_transaction_id`
        """
        parameters = [
            url,
            self.sender,
            self.customer_id,
            timestamp,
            self.language,
            self.organization_id,
            transaction_id,
            self.customer_key,
            self.partner_key,
        ]
        joined_parameters = b'&'.join(

            p.encode('utf-8') if isinstance(p, text_type) else p