#!/usr/bin/env perl use utf8; ############################################################################### # Program computes a simple checksum of STDIN # # Copyright © 2017 Richard Lesh. All rights reserved. ############################################################################### use Utils; use strict; use warnings; MAIN: { binmode(STDIN); my $c; my $checksum = 0; while (defined($c = Utils::getbyte(*STDIN))) { $checksum = Utils::bitwiseXOr32($checksum, $c); } print Utils::messageFormat("\{0:02X\}", $checksum), "\n"; }