コード例 #1
0
        public void TestDecode(string hex, int code, string name)
        {
            var ob = Hex.Decode(hex);
            var nb = Binary.Varint.GetBytes((uint)code).Concat(Binary.Varint.GetBytes((uint)ob.Length)).Concat(ob).ToArray();

            var dec = Multihash.Decode(nb);

            Assert.Equal((int)dec.Code, code);
            Assert.Equal(dec.Name, name);
            Assert.Equal(dec.Length, ob.Length);
            Assert.Equal(dec.Digest, ob);
        }
コード例 #2
0
ファイル: P2P.cs プロジェクト: thexdesk/cs-multiaddress
 public override void Decode(byte[] bytes) => Value = Multihash.Decode(bytes);