public void Write(BinaryWriter writer) { if (writer == null) { throw new ArgumentNullException(nameof(writer)); } PartialKey.Write(writer); EncryptedHeaderBlock.Write(writer); PlaintextHeaderBlock.Write(writer); writer.Write(B0Blocks.Count()); foreach (var block in B0Blocks) { block.Write(writer); } writer.Write(SequentialBlocks.Count()); foreach (var block in SequentialBlocks) { block.Write(writer); } }
public override int GetHashCode() { var hashCode = 2040108761; hashCode = hashCode * -1521134295 + PartialKey.GetHashCode(); hashCode = hashCode * -1521134295 + B0Blocks.Count().GetHashCode(); hashCode = hashCode * -1521134295 + SequentialBlocks.Count().GetHashCode(); return(hashCode); }
public bool Equals(RecoveryState other) { if (other is null) { return(false); } else { return(PartialKey == other.PartialKey && B0Blocks.Count() == other.B0Blocks.Count() && SequentialBlocks.Count() == other.SequentialBlocks.Count()); } }
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member public int CompareTo(RecoveryState other) { int cmp = other.B0Blocks.Count() - B0Blocks.Count(); if (cmp == 0) { cmp = other.SequentialBlocks.Count() - SequentialBlocks.Count(); if (cmp == 0) { cmp = PartialKey.CompareTo(other.PartialKey); } } return(cmp); }
public override string ToString() { return($"RecoveryState({B0Blocks.Count()},{SequentialBlocks.Count()},{PartialKey.ToString()})"); }