fix tensor rt engine

This commit is contained in:
zxsanny
2025-03-28 14:50:43 +02:00
committed by Alex Bezdieniezhnykh
parent 5b89a21b36
commit 06a23525a6
16 changed files with 272 additions and 94 deletions
+15 -5
View File
@@ -45,14 +45,24 @@ class Security:
return bytes(plaintext_bytes)
@staticmethod
def get_model_encryption_key():
key = '-#%@AzaionKey@%#---234sdfklgvhjbnn'
return Security.calc_hash(key)
@staticmethod
def calc_hash(key):
str_bytes = key.encode('utf-8')
hash_bytes = hashlib.sha384(str_bytes).digest()
h = base64.b64encode(hash_bytes).decode('utf-8')
return h
@staticmethod
def get_hw_hash(hardware):
key = f'Azaion_{hardware.mac_address}_{hardware.cpu}_{hardware.gpu}'
return Security.calc_hash(key)
@staticmethod
def get_api_encryption_key(creds, hardware_hash):
key = f'{creds.email}-{creds.password}-{hardware_hash}-#%@AzaionKey@%#---'
return Security.calc_hash(key)
@staticmethod
def get_model_encryption_key():
key = '-#%@AzaionKey@%#---234sdfklgvhjbnn'
return Security.calc_hash(key)