To turn digest into a CID, prefix it with fields required by CIDv1 spec:
<cidv1> ::= <version=0x01><codec=0x71><hash function code=0x12><digest size in bytes><hash function output, the 32 byte digest you've read>
github.com/multiformats...
github.com/multiformats...
github.com
GitHub - multiformats/cid: Self-describing content-addressed identifiers for distributed systems
Self-describing content-addressed identifiers for distributed systems - multiformats/cid