Total Complexity | 1 |
Total Lines | 17 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 0 |
1 | """Decode module for B58 multi hash.""" |
||
2 | |||
3 | from multiformats import CID |
||
4 | from base58check import b58encode |
||
5 | |||
6 | |||
7 | def decode(value: bytes) -> str: |
||
8 | """ |
||
9 | Decode B58 multi hash. |
||
10 | |||
11 | :param value: an encoded content |
||
12 | |||
13 | :return: the decoded content |
||
14 | """ |
||
15 | |||
16 | return b58encode(CID.decode(value).digest).decode('utf-8') |
||
17 |