Пример #1
0
        /// <summary>
        /// Initializes a new instance of tox dns3.
        /// </summary>
        /// <param name="publicKey"></param>
        public ToxDns(string publicKey)
        {
            _toxDns3 = ToxDnsFunctions.New(ToxTools.StringToHexBin(publicKey));

            if (_toxDns3 == null || _toxDns3.IsInvalid)
            {
                throw new Exception("Could not create a new tox_dns3 instance with the provided public_key");
            }
        }
Пример #2
0
        public void StringToHexBin_Result_AreEqual(string input, byte[] expected)
        {
            var result = ToxTools.StringToHexBin(input);

            Assert.AreEqual(expected, result);
        }
Пример #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ToxKey"/> class
 /// </summary>
 /// <param name="type"></param>
 /// <param name="key"></param>
 public ToxKey(ToxKeyType type, string key)
 {
     KeyType  = type;
     this.key = ToxTools.StringToHexBin(key);
 }