I\'m trying to replicate the logic of a Java application within a C# application. Part of this involves generating an SHA-1 ha
your question and the answer were very useful to me, but I noticed that when the password has the character "0" hash codes generated are different, so I changed a little the code (in Java).
for (int i = 0; i < hash.length; i++)
{
String hex = Integer.toHexString(hash[i]);
if (hex.length() == 1) hex = "0" + hex;
hex = hex.substring(hex.length() - 2);
result += hex;
}