mirror of
https://github.com/azaion/ai-training.git
synced 2026-04-22 11:16:35 +00:00
fix tensor rt engine
This commit is contained in:
committed by
Alex Bezdieniezhnykh
parent
5b89a21b36
commit
06a23525a6
+15
-5
@@ -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)
|
||||
Reference in New Issue
Block a user