1 """Emailage api tools module."""
2 import uuid
3
4
6 """Generate pseudo-random number and seconds since epoch (UTC)."""
7 nonce = uuid.uuid1()
8 oauth_timestamp, oauth_nonce = str(nonce.time), nonce.get_hex()
9 return oauth_nonce, oauth_timestamp
10
11
13 """Split the query from the url"""
14 try:
15 index = url.index('?')
16 except ValueError:
17 return url, ""
18 query = url[index + 1:]
19 url = url[:index]
20 return url, query
21