From 4c67e1221940fd9e2620041d03c1c1c88595583f Mon Sep 17 00:00:00 2001 From: CyberLeo Date: Sun, 5 Jan 2020 00:57:12 -0600 Subject: [PATCH] Add gzip crc32 algo Thanks to maronz@github https://gist.github.com/BluntBlade/7891642#gistcomment-2389964 --- flag | 1 + 1 file changed, 1 insertion(+) diff --git a/flag b/flag index 312fd1e..32e2dab 100755 --- a/flag +++ b/flag @@ -16,6 +16,7 @@ algo_crc32() { crc32 /dev/stdin; } algo_crc32sum() { crc32sum; } algo_crc32sum_linux() { crc32sum-linux; } algo_crc32sum_freebsd() { crc32sum-freebsd; } +algo_crc32_gzip() { gzip -c | tail -c 8 | od -An -N 4 -tx4 | tr -dc '0-9a-f\n'; } algo_python() { python -c 'import sys; import zlib; print "%08x\n" % (zlib.crc32("".join(sys.stdin.readlines())) & 0xFFFFFFFF)'; } algo_ruby() { ruby -e 'require "zlib"; printf "%08x\n", Zlib.crc32(STDIN.readlines.join)'; } algo_php() { php -r 'printf("%08x\n", crc32(file_get_contents("/dev/stdin")));'; } -- 2.42.0