Make more TLObject methods private

Even though raw API is somewhat necessary at times,
these methods should remain implementation details.
This commit is contained in:
Lonami Exo
2022-02-08 10:02:59 +01:00
parent 1f3ce07594
commit 84b016cf1c
9 changed files with 24 additions and 24 deletions

View File

@@ -41,8 +41,8 @@ def _compute_fingerprint(key):
:param key: the Crypto.RSA key.
:return: its 8-bytes-long fingerprint.
"""
n = tlobject.TLObject.serialize_bytes(get_byte_array(key.n))
e = tlobject.TLObject.serialize_bytes(get_byte_array(key.e))
n = tlobject.TLObject._serialize_bytes(get_byte_array(key.n))
e = tlobject.TLObject._serialize_bytes(get_byte_array(key.e))
# Telegram uses the last 8 bytes as the fingerprint
return struct.unpack('<q', sha1(n + e).digest()[-8:])[0]