public void Test16BytesVarint() { var data = Encoding.UTF8.GetBytes("this is some test content"); var hash = Multihash.Sum <SHA2_256>(data); var c = new Cid((MulticodecCode)(1UL << 63), hash); c.ToBytes(); }
public void TestBasicMarshaling() { var h = Multihash.Sum <SHA3_512>(Encoding.UTF8.GetBytes("TEST"), 4); var cid = new Cid(MulticodecCode.MerkleDAGCBOR, h); var data = cid.ToBytes(); var output = Cid.Cast(data); Assert.Equal(cid, output); var s = cid.ToString(); output = Cid.Decode(s); Assert.Equal(cid, output); }