From 20a237db1b80a5c3c98f9b21052936484b466f9a Mon Sep 17 00:00:00 2001 From: CyberLeo Date: Wed, 17 Jun 2015 20:38:45 -0500 Subject: [PATCH] Add Python crc32 algo --- flag | 1 + 1 file changed, 1 insertion(+) diff --git a/flag b/flag index 585bc08..312fd1e 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_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")));'; } algo_perl() { perl -e 'use String::CRC32; printf("%08x\n", crc32(*STDIN));'; } -- 2.42.0