my $data= pack('cccccccc',49,0,50,0,51,0,52,0); print sha1_hex($data); print sha1_base64($data);
prints out 139f69c93c042496a8e958ec5930662c6cccafbf, which is the hex form of your result and E59pyTwEJJao6VjsWTBmLGzMr78
So your c# encryption routine converts your string rather pointlessly IMHO to unicode and then hashes it. The pack method above has obvious limits, as soon as a char isn't in the same place on page 0 of the unicode charset your hash will be different again.
Do you need the new hash conform to the old or was it just the correctness of the code that was important?
UPDATE: http://perldoc.perl.org/Encode.html might provide methods to get at the underlying bytes of the unicode
In reply to Re: Rewriting a C# Encryption Function
by jethro
in thread Rewriting a C# Encryption Function
by bkiahg
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |