public void Encode_Decode_16_Seeds() { var lnk = new ELink(4999666333111, null); for(int seed = 0; seed < 16; seed++) { lnk.Encode((byte)seed); Console.WriteLine("{0} {1} -> {2}".Args(seed, lnk.Link, lnk.GDID)); var lnk2 = new ELink( lnk.Link ); Assert.AreEqual(lnk.ID, lnk2.ID); } }
public void Encode_Decode_Max() { var lnk = new ELink(ulong.MaxValue, null); lnk.Encode(1); var lnk2 = new ELink( lnk.Link ); Assert.AreEqual(lnk.ID, lnk2.ID); }
public void Encode_Min() { var lnk = new ELink(0, null); lnk.Encode(1); Assert.AreEqual("AIAIAJ-AJ", lnk.Link); }
public void Encode_Max() { var lnk = new ELink(ulong.MaxValue, null); lnk.Encode(1); Assert.AreEqual("CHBRHM-VIVIVIVI-VIVIVIVI", lnk.Link); }
public void Encode_Decode_Min() { var lnk = new ELink(0, null); lnk.Encode(1); var lnk2 = new ELink( lnk.Link ); Assert.AreEqual(lnk.ID, lnk2.ID); }
public void Encode_Decode_MetaOdd() { var lnk = new ELink(1, new byte[]{0x01, 0xfe, 0xda, 0x5, 0x07}); lnk.Encode(1); var lnk2 = new ELink( lnk.Link ); Assert.AreEqual(lnk.ID, lnk2.ID); Assert.AreEqual(0x01, lnk2.Metadata[0]); Assert.AreEqual(0xfe, lnk2.Metadata[1]); Assert.AreEqual(0xda, lnk2.Metadata[2]); Assert.AreEqual(0x05, lnk2.Metadata[3]); Assert.AreEqual(0x07, lnk2.Metadata[4]); }
private void button2_Click(object sender, EventArgs e) { var lnk = new ELink((ulong)tbID.Text.AsLong(0), null); lnk.Encode(1); tbELink.Text = lnk.Link; var lnk2 = new ELink( lnk.Link ); tbResult.Text = lnk2.ID.ToString(); }