Conditions | 1 |
Total Lines | 11 |
Code Lines | 4 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 2 |
Changes | 0 |
1 | """Python implementation of EIP 1577 content hash.""" |
||
8 | def decode(chash: str) -> str: |
||
9 | """ |
||
10 | Decode a content hash. |
||
11 | |||
12 | :param hash: a hex string containing a content hash |
||
13 | |||
14 | :return: the decoded content |
||
15 | """ |
||
16 | codec, raw_data = multicodec.unwrap(bytes.fromhex(chash.lstrip('0x'))) |
||
17 | profile = get_profile(codec.name) |
||
18 | return profile.decode(raw_data) |
||
19 | |||
44 |