public Property EncodeDecodeAreDuals_Classified(Mod4Binary input) { var processed = Z85.Decode(Z85.Encode(input.Data)); return processed.SequenceEqual(input.Data) // bucket by common sizes .Classify(input.IsLarge (),"Large (64 .. ∞ bytes)" ) .Classify(input.IsMedium(),"Medium (24 .. 60 bytes)") .Classify(input.IsSmall (),"Small (8 .. 20 bytes)" ) .Classify(input.IsTiny (),"Tiny (0 .. 4 bytes)" ); }
public Property EncodeDecodeAreDuals_Classified(Mod4Binary input) { var processed = Z85.Decode(Z85.Encode(input.Data)); return(processed.SequenceEqual(input.Data) // bucket by common sizes .Classify(input.IsLarge(), "Large (64 .. ∞ bytes)") .Classify(input.IsMedium(), "Medium (24 .. 60 bytes)") .Classify(input.IsSmall(), "Small (8 .. 20 bytes)") .Classify(input.IsTiny(), "Tiny (0 .. 4 bytes)")); }
public Property EncodeDecodeAreDuals_Combined(Mod4Binary input) { var processed = Z85.Decode(Z85.Encode(input.Data)); return processed.SequenceEqual(input.Data) // identify a special case .Trivial(input.Data.Any (b => b == 70)) // bucket by common sizes .Classify(input.IsLarge (),"Large (64 .. ∞ bytes)" ) .Classify(input.IsMedium(),"Medium (24 .. 60 bytes)") .Classify(input.IsSmall (),"Small (8 .. 20 bytes)" ) .Classify(input.IsTiny (),"Tiny (0 .. 4 bytes)" ) // gather individual sizes .Collect(input.Data.Length); }
public Property EncodeDecodeAreDuals_Combined(Mod4Binary input) { var processed = Z85.Decode(Z85.Encode(input.Data)); return(processed.SequenceEqual(input.Data) // identify a special case .Trivial(input.Data.Any(b => b == 70)) // bucket by common sizes .Classify(input.IsLarge(), "Large (64 .. ∞ bytes)") .Classify(input.IsMedium(), "Medium (24 .. 60 bytes)") .Classify(input.IsSmall(), "Small (8 .. 20 bytes)") .Classify(input.IsTiny(), "Tiny (0 .. 4 bytes)") // gather individual sizes .Collect(input.Data.Length)); }