diff --git a/bzip2/src/main/scala/zio/compress/Bzip2BlockSize.scala b/bzip2/src/main/scala/zio/compress/Bzip2BlockSize.scala index f01efeb..fc21403 100644 --- a/bzip2/src/main/scala/zio/compress/Bzip2BlockSize.scala +++ b/bzip2/src/main/scala/zio/compress/Bzip2BlockSize.scala @@ -5,7 +5,7 @@ package zio.compress * @param hundredKbIncrements * a bzip2 block size in 100KB increments, valid values: 1 to 9 */ -final case class Bzip2BlockSize(hundredKbIncrements: Int) +final case class Bzip2BlockSize private (hundredKbIncrements: Int) object Bzip2BlockSize { diff --git a/zstd/src/main/scala/zio/compress/ZstdCompressionLevel.scala b/zstd/src/main/scala/zio/compress/ZstdCompressionLevel.scala index 1183bff..0d3ccde 100644 --- a/zstd/src/main/scala/zio/compress/ZstdCompressionLevel.scala +++ b/zstd/src/main/scala/zio/compress/ZstdCompressionLevel.scala @@ -56,3 +56,9 @@ object ZstdCompressionLevel { val VeryHighCompressionLevel: ZstdCompressionLevel = CompressionLevel19 val UltraCompressionLevel: ZstdCompressionLevel = CompressionLevelUltra22 } + +// The minimum level of -131072 was calculated as `-(1L << 17)` +// and was derived from the C implementation of Zstd. See: +// https://github.com/facebook/zstd/blob/b880f20d52a925ebee373b5050c206ba325d935d/lib/compress/zstd_compress.c#L6988, +// https://github.com/facebook/zstd/blob/b880f20d52a925ebee373b5050c206ba325d935d/lib/zstd.h#L1249 and +// https://github.com/facebook/zstd/blob/b880f20d52a925ebee373b5050c206ba325d935d/lib/zstd.h#L142-L143.