public static string CompressStrings(string data, Encoding encoding = null, int windowLength = -1) { data.AssertHasText(nameof(data)); encoding = encoding ?? Encoding.UTF8; byte[] inputData = encoding.GetBytes(data); LZ77 lz = new LZ77(); byte[] compressed = lz.Compress(inputData, windowLength); return(encoding.GetString(compressed)); }
public static byte[] CompressBytes(byte[] data, int windowLength = -1) { LZ77 lz = new LZ77(); return(lz.Compress(data, windowLength)); }