#!/usr/bin/perl -wT

use strict;
use warnings;
use Digest::CRC;
use MIME::Base64;

my $ctx = Digest::CRC->new(type=>'crc32');
my $data = 'abc1234' x 17;

$ctx->add($data);
printf("  dec: %d\n", $ctx->digest);
$ctx->add($data);
printf(" phex: %06x\n", $ctx->digest);
$ctx->add($data);
printf("inhex: %s\n", $ctx->hexdigest);
$ctx->add($data);
printf(" pb64: %s", encode_base64(pack("H*", sprintf("%08x", $ctx->digest))));
$ctx->add($data);
printf("inb64: %s\n", $ctx->b64digest);

