Skip to content

Commit

Permalink
feat: estimate compressed size
Browse files Browse the repository at this point in the history
  • Loading branch information
ikpil committed Oct 1, 2023
1 parent 895a258 commit e81b8fa
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/DotFastLZ.Compression/FastLZ.cs
Original file line number Diff line number Diff line change
Expand Up @@ -639,5 +639,11 @@ public static void MemMove(byte[] dest, long destOffset, byte[] src, long srcOff
dest[destOffset + i] = src[srcOffset + i];
}
}

public static long EstimateCompressedSize(long size)
{
long estimatedSize = (long)Math.Ceiling(size * 1.06f);
return Math.Max(estimatedSize, 66);
}
}
}

0 comments on commit e81b8fa

Please sign in to comment.