System.HashID.HashID C# (CSharp) Метод

HashID() публичный Метод

public HashID ( string hash ) : System.Globalization
hash string
Результат System.Globalization
        public HashID(string hash)
        {
            if (hash.Length != 64) throw new ArgumentException("Hash value length is incorrect. Length must be 64 characters.", "hash");

            var harr = new byte[32];
            for (int i = 0; i < 32; i++)
                harr[i] = byte.Parse(hash.Substring(i*2, 2), NumberStyles.HexNumber);

            first = BitConverter.ToUInt64(harr, 0);
            second = BitConverter.ToUInt64(harr, 8);
            third = BitConverter.ToUInt64(harr, 16);
            fourth = BitConverter.ToUInt64(harr, 24);

            longhashcode = first ^ second ^ third ^ fourth;
            byte[] hca = BitConverter.GetBytes(longhashcode);
            int hcl = BitConverter.ToInt32(hca, 0); //Hash Code ulong Low
            int hch = BitConverter.ToInt32(hca, 4); //Hash Code ulong High
            hashcode = hcl ^ hch;
        }

Same methods

HashID::HashID ( byte hash ) : System.Globalization