const CID = require('cids') const multihashing = require('multihashing-async') export async function createCid(buf: Buffer, alg: string = 'sha2-256', codec: string = 'dag-pb'): Promise { const hash = await multihashing(buf, alg) const cid = new CID(1, codec, hash) return cid.toString(); }