content_hash.utils   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 9
ccs 0
cts 3
cp 0
rs 10
c 0
b 0
f 0
wmc 1

1 Function

Rating   Name   Duplication   Size   Complexity  
A raw_cid_value() 0 4 1
1
"""Util functions used in the project"""
2
3
from multiformats import multicodec
4
5
def raw_cid_value(cid):
6
    """Return raw representation of the CID as seen in multiformats_cid in bytes"""
7
    return b''.join(
8
        [cid.version.to_bytes(1, byteorder='big'), multicodec.wrap(cid.codec, cid.digest)],
9
    )
10