mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2025-12-31 20:36:24 +00:00
style: enforce consistent import block
This commit is contained in:
@ -1,12 +1,9 @@
|
||||
import functools
|
||||
import hashlib
|
||||
|
||||
import base58
|
||||
import multihash
|
||||
|
||||
from functools import (
|
||||
cached_property,
|
||||
)
|
||||
|
||||
from libp2p.crypto.keys import (
|
||||
PublicKey,
|
||||
)
|
||||
@ -44,11 +41,11 @@ class ID:
|
||||
def __init__(self, peer_id_bytes: bytes) -> None:
|
||||
self._bytes = peer_id_bytes
|
||||
|
||||
@cached_property
|
||||
@functools.cached_property
|
||||
def xor_id(self) -> int:
|
||||
return int(sha256_digest(self._bytes).hex(), 16)
|
||||
|
||||
@cached_property
|
||||
@functools.cached_property
|
||||
def base58(self) -> str:
|
||||
return base58.b58encode(self._bytes).decode()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user