For the complete documentation index, see llms.txt. This page is also available as Markdown.

Python Token Generator Code

Example Python code to generate an API Token

import hmac
import time

def token(secret, ip, timestamp):
        message = '%s:%s:%s' % (secret, ip, timestamp)
        digest_maker = hmac.new(secret.encode(), message.encode(), "MD5")
        return digest_maker.hexdigest()
        
secret = 'testsecret'
timestamp = int(round(time.time() * 1000))
ip = '192.168.1.1'

print token(secret, ip, timestamp)

Example

Running this code with the timestamp 1424082443000 yields the value:

092268a2d33f46bf990676efdab34d2d

Last updated

Was this helpful?