示例#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
 public KeyToken(Byte[] token, System.Net.EndPoint ep)
 {
     _token    = token;
     _endpoint = ep;
     _hash     = ByteArrayUtils.ComputeHash(_token) * 31 + ep.GetHashCode();
 }
示例#5
0
 public KeyID(Int32 id, System.Net.EndPoint ep)
 {
     _id       = id;
     _endpoint = ep;
     _hash     = id * 31 + ep.GetHashCode();
 }