unpack takes a binary string and turns it into a list. the H* is the
template used to pack/unpack...H* i think is a template to do a
Hexdecimal pack/unpack. I would first try
tobinary(tostring(packed_var)) and see where that leads and work form
there...I do a good bit of perl programing but never use pack/unpack
just remember it from one of my Perl Trainings :)
Adam H
On Mon, 7 Feb 2005 18:04:36 -0500, Troy Simpson <[EMAIL PROTECTED]> wrote:
> I have some perl that I need to translate into ColdFusion and I am
> having a little trouble with the understanding Base64 stuff.
>
> It has been almost 5 years since I have done any perl, so that is
> giving a little trouble also. Especially the unpack statement.
>
> Does anyone know what this means and what it might look like in ColdFusion?
>
> # read modulus
> chomp $modulus;
> $modulus = unpack('H*', MIME::Base64::decode($modulus) );
> $modulus = substr($modulus, -$MessageHexChars);
> $modulus = "0" x ($MessageHexChars - length($modulus)) . $modulus;
> $PublicKeyModulus = $modulus;
>
> # read exponent
> chomp $exponent;
> $exponent = unpack('H*', MIME::Base64::decode($exponent) );
> $exponent = substr($exponent, -$MessageHexChars);
> $exponent = "0" x ($MessageHexChars - length($exponent)) . $exponent;
> $PublicKeyExponent = $exponent;
>
> Thanks,
> Troy
>
> --
> Troy Simpson
> Applications Analyst/Programmer, OCPDBA, MCSE, SCSA
> North Carolina State University Libraries
> Campus Box 7111 | Raleigh | North Carolina
> ph.919.515.3855 | fax.919.513.3330
> E-mail: [EMAIL PROTECTED]
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking
application. Start tracking and documenting hours spent on a project or with a
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:193489
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54