On 05/05/2011 10:53 AM, apm wrote:
I have old legacy code on .net 1.1 c#

Byte[] clearBytes = new UnicodeEncoding().GetBytes(cleanString); Byte[] hashedBytes = ((HashAlgorithm) CryptoConfig.CreateFromName("MD5")).ComputeHash(clearBytes);

            return BitConverter.ToString(hashedBytes);

how convert it into perl?
i trying this:
use utf8;
use Digest::MD5 qw ( md5 md5_hex md5_base64);
return uc(md5_hex(unpack("U*",$pass)))

but hash differs.

also trying unpack("H*"...



Did just md5_hex($pass) not work?

To help you diagnose this, some octet-streams of passwords and what your C# program hashed them to would be helpful.

--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/


Reply via email to