Skip to main content

cid_from_bytes

Function cid_from_bytes 

Source
pub fn cid_from_bytes(data: &[u8]) -> String
Expand description

Compute a CIDv1 (base32-lower, SHA2-256, raw codec) string for data.

The encoding is:

<varint version=1><varint codec=0x55><varint mh-fn=0x12><varint mh-len=32><32-byte-digest>

encoded in lowercase RFC 4648 base32 with the b multibase prefix.