Hi guys, I have a JAVA code that works perfect for Digesting string. Now I have tried changing it to fit in UiPath, they both work but producing different results. See below original JAVA code and how I change it to fit in UiPath.
IN JAVA:
String dgStr = "TestingStringDigestion";
byte[] enc = MessageDigest.getInstance("SHA-256").digest(dgStr.getBytes());
Console.WriteLine( new String(Base64.encodeBase64(enc)) );
IN UIPATH:
Assign Activity |=> dgStr = "TestingStringDigestion"
Hash Text Activity |=> Algorithm = SHA256 : Text = dgStr
Assign Activity |=> dgStrBytes [] = Encoding.UTF8.GetBytes(dgStrBytes)
Assign Activity |=> dgStrFLN = String.Join("", dgStrBytes)
Write Line Activity |=> System.Convert.ToBase64String(dgStrFLN).ToString
I would like know is the conversion above correct, and why does it produce different results.