mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-08 04:52:30 +00:00
Use autogen code on the authenticator instead hardcoding requests
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import os
|
||||
import struct
|
||||
from hashlib import sha1
|
||||
try:
|
||||
import rsa
|
||||
@@ -37,7 +38,7 @@ def _compute_fingerprint(key):
|
||||
n = TLObject.serialize_bytes(get_byte_array(key.n))
|
||||
e = TLObject.serialize_bytes(get_byte_array(key.e))
|
||||
# Telegram uses the last 8 bytes as the fingerprint
|
||||
return sha1(n + e).digest()[-8:]
|
||||
return struct.unpack('<q', sha1(n + e).digest()[-8:])[0]
|
||||
|
||||
|
||||
def add_key(pub):
|
||||
|
Reference in New Issue
Block a user