예제 #1
0
        public static int ContentLength(byte[] responseHeader, int length)
        {
            var hash = Murmur2.Hash(responseHeader);
            int contentLength;

            if (Headers.ContainsKey(hash))
            {
                contentLength = Headers[hash].ContentLenght;
            }
            else
            {
                var headers = Parse(responseHeader, length);
                Headers.Add(hash, headers);
                contentLength = headers.ContentLenght;
            }
            return(contentLength);
        }
예제 #2
0
 public static string MurmurHash(this string url)
 {
     return(Murmur2.HashX8(url, Encoding.ASCII));
 }