예제 #1
0
 public KeyID(Int32 id, System.Net.EndPoint ep, ISession session)
 {
     _id       = id;
     _endpoint = ep;
     _session  = session;
     _hash     = id * 31 + (ep == null ? 0 : ep.GetHashCode());
 }
예제 #2
0
            public KeyUri(Uri uri, byte[] oscoap, System.Net.EndPoint ep)
            {
                _uri      = uri;
                _endpoint = ep;
                _oscoap   = oscoap;
                _hash     = _uri.GetHashCode() * 31 + ep.GetHashCode();

                if (oscoap != null)
                {
                    Int32 hash2 = 0;
                    for (int i = 0; i < oscoap.Length; i++)
                    {
                        hash2 = hash2 * 7 + oscoap[i];
                    }
                    _hash += hash2 * 71;
                }
            }
예제 #3
0
 public KeyUri(Uri uri, System.Net.EndPoint ep)
 {
     _uri      = uri;
     _endpoint = ep;
     _hash     = _uri.GetHashCode() * 31 + ep.GetHashCode();
 }
예제 #4
0
파일: Exchange.cs 프로젝트: wfvvfw/CoAP.NET
 public KeyToken(Byte[] token, System.Net.EndPoint ep)
 {
     _token    = token;
     _endpoint = ep;
     _hash     = ByteArrayUtils.ComputeHash(_token) * 31 + ep.GetHashCode();
 }
예제 #5
0
파일: Exchange.cs 프로젝트: wfvvfw/CoAP.NET
 public KeyID(Int32 id, System.Net.EndPoint ep)
 {
     _id       = id;
     _endpoint = ep;
     _hash     = id * 31 + ep.GetHashCode();
 }