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 + MovieCollectionId.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); }
/// <summary> /// Returns this instance ToString /// </summary> public override string ToString() { return(MovieCollectionId.ToString() + "," + MovieId.ToString()); }