/// <summary> /// Returns a hash code for this instance. /// </summary> /// <returns> /// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. /// </returns> public override int GetHashCode() { return(Settings.TimeToLive.GetHashCode() ^ UtcCreated.ToString("u", CultureInfo.InvariantCulture).GetHashCode() ^ Token.GetHashCode() ^ Settings.Reference.GetHashCode()); }
/// <summary> /// Returns a <see cref="string"/> that represents this instance in the following format: ttl;created;token;. /// </summary> /// <returns> /// A <see cref="string"/> that represents this instance in the following format: ttl;created;token;. /// </returns> public override string ToString() { bool enableBackwardCompatibility = string.IsNullOrEmpty(Settings.Reference); return(string.Format(CultureInfo.InvariantCulture, enableBackwardCompatibility ? "\"{0}\";\"{1}\";\"{2}\";" : "\"{0}\";\"{1}\";\"{2}\";\"{3}\";", Settings.TimeToLive.Ticks, UtcCreated.ToString("u", CultureInfo.InvariantCulture), Token, Settings.Reference)); }