please rewrite this function to use mmh3 library for hashing, currently its using some javascript thingy.

import secrets
import time

config={
    'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36'
}

def get_browser_data():
    ## Calculate encryption key
    ts = time.time()
    timeframe = int(ts - (ts % 21600))
    key = config['user-agent'] + str(timeframe)

    ## Data
    data = []
    data.append({"key": "api_type", "value": "js"})
    data.append({"key": "p", "value": 1})

    ## Fingerprint
    fonts = "Arial,Arial Black,Arial Narrow,Book Antiqua,Bookman Old Style,Calibri,Cambria,Cambria Math,Century,Century Gothic,Century Schoolbook,Comic Sans MS,Consolas,Courier,Courier New,Garamond,Georgia,Helvetica,Impact,Lucida Bright,Lucida Calligraphy,Lucida Console,Lucida Fax,Lucida Handwriting,Lucida Sans,Lucida Sans Typewriter,Lucida Sans Unicode,Microsoft Sans Serif,Monotype Corsiva,MS Gothic,MS PGothic,MS Reference Sans Serif,MS Sans Serif,MS Serif,Palatino Linotype,Segoe Print,Segoe Script,Segoe UI,Segoe UI Light,Segoe UI Semibold,Segoe UI Symbol,Tahoma,Times,Times New Roman,Trebuchet MS,Verdana,Wingdings,Wingdings 2,Wingdings 3".split(",")
    plugins = "Chrome PDF Plugin,Chrome PDF Viewer,Native Client".split(",")
    canvas_fp = -1424337346

    fe = [
        ## DoNotTrack flag
        "DNT:unknown",
        ## Language
        "L:en-US",
        ## Depth
        "D:24",
        ## Pixel ratio
        "PR:1",
        ## Screen resolution
        "S:1920,1080",
        ## Available screen resolution (browser window size)
        "AS:1920,1040",
        ## Time offset
        "TO:-120",
        ## Session storage enabled
        "SS:true",
        ## Local storage enabled
        "LS:true",
        ## Indexed DB enabled
        "IDB:true",
        ## .addBehaviour enabled - https://docs.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/platform-apis/ms535922(v%3Dvs.85)
        "B:false",
        ## OpenDB enabled
        "ODB:true",
        ## CPU class
        "CPUC:unknown",
        ## Platform key
        "PK:Win32",
        ## Canvas fingerprint
        "CFP:" + str(canvas_fp),
        ## Has fake resolution
        "FR:false",
        ## Has fake OS
        "FOS:false",
        ## Has fake browser
        "FB:false",
        ## Javascript fonts
        "JSF:" + ",".join(fonts),
        ## Plugin keys
        "P:" + ",".join(plugins),
        ## Touch
        "T:0,false,false",
        ## navigator.hardwareConcurrency value
        "H:8",
        ## Flash enabled
        "SWF:false"]
    
    ## Calculate hashes
    ## I haven't managed to replicate fp hashes yet, so it's just filled with a random value for now
    fp = secrets.token_hex(16)
    ife_hash = mm3js.call("x64hash128", ", ".join(fe), 38)

    ## Window hash
    ## This cannot be verified by the server, so it's just a random value for now
    wh = secrets.token_hex(16) + "|" + secrets.token_hex(16)
    
    ## Additional data
    data.append({"key": "f", "value": fp})
    data.append({"key": "n", "value": base64.b64encode(str(int(ts)).encode("utf-8")).decode("utf-8")})
    data.append({"key": "wh", "value": wh})
    data.append({"key": "fe", "value": fe})
    data.append({"key": "ife_hash", "value": ife_hash})
    data.append({"key": "cs", "value": 1})
    data.append({"key": "jsbd", "value": '{"HL":28,"NCE":true,"DA":null,"DR":null,"DMT":31,"DO":null,"DOT":31}'})

    data = json.dumps(data, separators=(',', ':'))
    data = cryptojs_encrypt(data, key)
    data = base64.b64encode(data.encode("utf-8")).decode("utf-8")
    return data

print(get_browser_data())




some examples of mmh3:
>>> import mmh3
>>> mmh3.hash("foo") # returns a 32-bit signed int
-156908512
>>> mmh3.hash("foo", 42) # uses 42 as a seed
-1322301282
>>> mmh3.hash("foo", signed=False) # returns a 32-bit unsigned int
4138058784

Other functions:

>>> mmh3.hash64("foo") # two 64 bit signed ints (by using the 128-bit algorithm as its backend)
(-2129773440516405919, 9128664383759220103)
>>> mmh3.hash64("foo", signed=False) #  two 64 bit unsigned ints
(16316970633193145697, 9128664383759220103)
>>> mmh3.hash128("foo", 42) # 128 bit unsigned int
215966891540331383248189432718888555506
>>> mmh3.hash128("foo", 42, signed=True) # 128 bit signed int
-124315475380607080215185174712879655950
>>> mmh3.hash_bytes("foo") # 128 bit value as bytes
'aE\xf5\x01W\x86q\xe2\x87}\xba+\xe4\x87\xaf~'
>>> import numpy as np
>>> a = np.zeros(2 ** 32, dtype=np.int8)
>>> mmh3.hash_bytes(a)
b'V\x8f}\xad\x8eNM\xa84\x07FU\x9c\xc4\xcc\x8e'