We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 85bad2d commit fcf0546Copy full SHA for fcf0546
libp2p/peer/id.py
@@ -1,12 +1,9 @@
1
+import functools
2
import hashlib
3
4
import base58
5
import multihash
6
-from functools import (
7
- cached_property,
8
-)
9
-
10
from libp2p.crypto.keys import (
11
PublicKey,
12
)
@@ -44,11 +41,11 @@ class ID:
44
41
def __init__(self, peer_id_bytes: bytes) -> None:
45
42
self._bytes = peer_id_bytes
46
43
47
- @cached_property
+ @functools.cached_property
48
def xor_id(self) -> int:
49
return int(sha256_digest(self._bytes).hex(), 16)
50
51
52
def base58(self) -> str:
53
return base58.b58encode(self._bytes).decode()
54
0 commit comments