ori smaug has asked for the wisdom of the Perl Monks concerning the following question:
Hi all I have a c# code that i would like to convert to a perl script. can any one help? thanks this is the code:
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Security.Cryptography; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; public class Program { public static void Main() { var myString = "7512"; var o = CalculateMD5Hash(myString); Console.WriteLine("Generated String is: {0}", o); } public static string CalculateMD5Hash(string input) { HashAlgorithm ha = new MD5CryptoServiceProvider(); string prefix = "MD5:"; string password = ""; UnicodeEncoding enc = new UnicodeEncoding(); password = Convert.ToBase64String(ha.ComputeHash(enc.GetBytes( +input))); return prefix+password; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: convert c# to perl code
by marto (Cardinal) on Jan 01, 2019 at 13:03 UTC | |
by ori smaug (Novice) on Jan 01, 2019 at 13:48 UTC | |
by haukex (Archbishop) on Jan 01, 2019 at 14:09 UTC | |
by ori smaug (Novice) on Jan 01, 2019 at 14:29 UTC | |
by ori smaug (Novice) on Jan 01, 2019 at 14:32 UTC | |
|
Re: convert c# to perl code
by holli (Abbot) on Jan 01, 2019 at 18:34 UTC |