content_hash.decodes.hex_multi_hash.decode()   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 10
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 2
nop 1
dl 0
loc 10
ccs 0
cts 2
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
"""Decode module for HEX multi hash."""
2
3
from multiformats import multihash, CID
4
5
6
def decode(value):
7
    """
8
    Decode HEX multi hash.
9
10
    :param bytes value: an encoded content
11
12
    :return: the decoded content
13
    :rtype: str
14
    """
15
    return multihash.unwrap(CID.decode(value).digest).hex()
16