示例#1
0
        private int generateHashCode()
        {
            //THis is expensive and should be done only once since it will not be changing
            //TODO - use / include the "correct" id..
            String key = this.GetType().Name + ProductionCompanyId.ToString() + MovieId.ToString();

            //Google: "disable fips mode" if the line below fails
            System.Security.Cryptography.MD5 md5Hasher = System.Security.Cryptography.MD5.Create();
            var hashed = md5Hasher.ComputeHash(Encoding.UTF8.GetBytes(key));
            int ivalue = BitConverter.ToInt32(hashed, 0);

            return(ivalue);
        }
示例#2
0
 /// <summary>
 /// Returns this instance ToString
 /// </summary>
 public override string ToString()
 {
     return(ProductionCompanyId.ToString() + "," + MovieId.ToString());
 }