B
blaine
Hello,
I've been trying to come up with a way to compress part of a url to
make it shorter.
Below I have an example of a variable for my url and want it smaller
sized ascii. I've been trying the Compress:Zlib, however this doesn't
output ascii.. Any ideas?
use Compress::Zlib;
#------ deflate -------
my ($out, $out1, $status, $nout);
my $x = deflateInit() or die "this text has been deflated/inflated";
my $testStream =
"CIAQEDEUDVvVEwEEChDtDaAVCHAhBFANADBeAlEqCvDrCgDHDeDyClBREgBSCFEdBIBbDeCYACBLEWAwEaEECMBjBvCEBiEbCCCgABEAElBNCsEYDFCODEEoECDaDgADCtEhBpAOCACGDECsCfBsCPAaBhAaDeDTECERBdEIBuEiEjDqCgEQBPDjBQAEEjDtDFCMDaDfAuCwEfChCmEmDtDRDlBdBYACBkDYEpEnDoCMAJETEcDxEC";
($out,$status) = $x->deflate($testStream);
$status == Z_OK or die "deflation failed\n";
($out1, $status) = $x->flush();
$out .= $out1;
$status == Z_OK or die "deflation failed\n";
print "deflated output: [$out]\n";
I've been trying to come up with a way to compress part of a url to
make it shorter.
Below I have an example of a variable for my url and want it smaller
sized ascii. I've been trying the Compress:Zlib, however this doesn't
output ascii.. Any ideas?
use Compress::Zlib;
#------ deflate -------
my ($out, $out1, $status, $nout);
my $x = deflateInit() or die "this text has been deflated/inflated";
my $testStream =
"CIAQEDEUDVvVEwEEChDtDaAVCHAhBFANADBeAlEqCvDrCgDHDeDyClBREgBSCFEdBIBbDeCYACBLEWAwEaEECMBjBvCEBiEbCCCgABEAElBNCsEYDFCODEEoECDaDgADCtEhBpAOCACGDECsCfBsCPAaBhAaDeDTECERBdEIBuEiEjDqCgEQBPDjBQAEEjDtDFCMDaDfAuCwEfChCmEmDtDRDlBdBYACBkDYEpEnDoCMAJETEcDxEC";
($out,$status) = $x->deflate($testStream);
$status == Z_OK or die "deflation failed\n";
($out1, $status) = $x->flush();
$out .= $out1;
$status == Z_OK or die "deflation failed\n";
print "deflated output: [$out]\n";