Conditions | 1 |
Total Lines | 11 |
Code Lines | 3 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 2 |
Changes | 0 |
1 | """Python implementation of EIP 1577 content hash.""" |
||
21 | def encode(codec: str, value: str) -> str: |
||
22 | """ |
||
23 | Encode a content hash. |
||
24 | |||
25 | :param codec: a codec of a content hash |
||
26 | :param value: a value of a content hash |
||
27 | |||
28 | :return: the resulting content hash |
||
29 | """ |
||
30 | value = get_profile(codec).encode(value) |
||
31 | return multicodec.wrap(codec, value).hex() |
||
32 | |||
44 |