Beispiel #1
0
        public void TestToString()
        {
            var bytes = new byte[20];
            var id = new KademliaId(bytes);

            // Length must be okay
            Assert.AreEqual("0000000000000000000000000000000000000000", id.ToString().ToLower());

            bytes[0] = 0xff;
            id = new KademliaId(bytes);
            Assert.AreEqual("ff00000000000000000000000000000000000000", id.ToString().ToLower());

            bytes[0] = 0x00;
            bytes[19] = 0xff;
            id = new KademliaId(bytes);
            Assert.AreEqual("00000000000000000000000000000000000000ff", id.ToString().ToLower());
        }
Beispiel #2
0
 private string PathFor(KademliaId id)
 {
     return Path.Combine(config.StoreDirectory, id.ToString());
 }