import time
import hmac
import hashlib


def get_yuqing_token_now(api_secret, api_key):
    """Get token for yuqing service, using timestamp for now.

    :param api_secret: str, yuqing api secret
    :param api_key: str, yuqing api key
    :returns: (timestamp, token) for yuqing service
    :rtype: (string, string)

    """
    # Beware: timestamp for yuqing is of different format from bce_signer
    timestamp = str(int(time.time()))
    token = hmac.new(api_secret.encode('utf-8'),
                     (api_key + timestamp).encode('utf-8'),
                     hashlib.sha1).hexdigest()
    return timestamp, token