From 8f18b4b4e6de05b86036973e69aeaa1a31f7d271 Mon Sep 17 00:00:00 2001 From: Yann Collet Date: Fri, 29 Jul 2022 22:18:02 +0200 Subject: introduced new `--no-crc` command which disables both frame and block checksums. --- programs/lz4.1.md | 3 +++ programs/lz4cli.c | 1 + tests/Makefile | 2 ++ 3 files changed, 6 insertions(+) diff --git a/programs/lz4.1.md b/programs/lz4.1.md index 56c0053..39dc925 100644 --- a/programs/lz4.1.md +++ b/programs/lz4.1.md @@ -188,6 +188,9 @@ only the latest one will be applied. * `--[no-]frame-crc`: Select frame checksum (default:enabled) +* `--no-crc`: + Disable both frame and block checksums + * `--[no-]content-size`: Header includes original size (default:not present)
Note : this option can only be activated when the original size can be diff --git a/programs/lz4cli.c b/programs/lz4cli.c index ca4951e..51969fd 100644 --- a/programs/lz4cli.c +++ b/programs/lz4cli.c @@ -391,6 +391,7 @@ int main(int argc, const char** argv) || (!strcmp(argument, "--to-stdout"))) { forceStdout=1; output_filename=stdoutmark; continue; } if (!strcmp(argument, "--frame-crc")) { LZ4IO_setStreamChecksumMode(prefs, 1); BMK_skipChecksums(0); continue; } if (!strcmp(argument, "--no-frame-crc")) { LZ4IO_setStreamChecksumMode(prefs, 0); BMK_skipChecksums(1); continue; } + if (!strcmp(argument, "--no-crc")) { LZ4IO_setStreamChecksumMode(prefs, 0); LZ4IO_setBlockChecksumMode(prefs, 0); BMK_skipChecksums(1); continue; } if (!strcmp(argument, "--content-size")) { LZ4IO_setContentSize(prefs, 1); continue; } if (!strcmp(argument, "--no-content-size")) { LZ4IO_setContentSize(prefs, 0); continue; } if (!strcmp(argument, "--list")) { mode = om_list; continue; } diff --git a/tests/Makefile b/tests/Makefile index d804f25..d266ae5 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -376,6 +376,7 @@ test-lz4-basic: lz4 datagen unlz4 lz4cat $(LZ4) --no-frame-crc < $(FPREFIX)-dg20k | $(LZ4) -d > $(FPREFIX)-dec $(DIFF) -q $(FPREFIX)-dg20k $(FPREFIX)-dec $(DATAGEN) | $(LZ4) -BI | $(LZ4) -t + $(DATAGEN) | $(LZ4) --no-crc | $(LZ4) -t $(DATAGEN) -g6M -P99 | $(LZ4) -9BD | $(LZ4) -t $(DATAGEN) -g17M | $(LZ4) -9v | $(LZ4) -qt $(DATAGEN) -g33M | $(LZ4) --no-frame-crc | $(LZ4) -t @@ -479,6 +480,7 @@ test-lz4-testmode: lz4 datagen $(DATAGEN) > $(FPREFIX) $(LZ4) -f $(FPREFIX) -c > $(FPREFIX).lz4 $(LZ4) -bdi0 $(FPREFIX).lz4 # test benchmark decode-only mode + $(LZ4) -bdi0 --no-crc $(FPREFIX).lz4 # test benchmark decode-only mode @echo "\n ---- test mode ----" ! $(DATAGEN) | $(LZ4) -t ! $(DATAGEN) | $(LZ4) -tf -- cgit v0.12