I need this line of Java code:
Integer.toString(256 + (0xFF & arrayOfByte[i]), 16).substring(1)
converted to C# since I'm not sure how to work with "0xFF".
EDIT This is the full code:
MessageDigest localMessageDigest = MessageDigest.getInstance("SHA-256");
localMessageDigest.update(String.format(Locale.US, "%s:%s", new Object[] { paramString1, paramString2 }).getBytes());
byte[] arrayOfByte = localMessageDigest.digest();
StringBuffer localStringBuffer = new StringBuffer();
for (int i = 0; ; i++)
{
if (i >= arrayOfByte.length)
return localStringBuffer.toString();
localStringBuffer.append(Integer.toString(256 + (0xFF & arrayOfByte[i]), 16).substring(1));
}
0xFFas AFAIK it's too small and doesn't have MSB set so shouldn't encounter any need forunchecked.(0xFF & arrayOfByte[i])and(-1 & arrayOfByte[i])are not the same.