I want to hash a String with C# in Xamarin.
Normally I'd use:
public string SHA512StringHash(String input)
SHA512 shaM = new SHA512Managed();
// Convert the input string to a byte array and compute the hash.
byte data = shaM.ComputeHash(Encoding.UTF8.GetBytes(input));
// Create a new Stringbuilder to collect the bytes
// and create a string.
StringBuilder sBuilder = new StringBuilder();
// Loop through each byte of the hashed data
// and format each one as a hexadecimal string.
for (int i = 0; i < data.Length; i++)
// Return the hexadecimal string.
input = sBuilder.ToString();
I found the solution,
i was trying to create this class in the Forms Solution, but in this Solution
is not available.
In the iOS and Android Solution it is available.
So i implemented an Interface in the Forms Solution and used the Method in the iOS and Android Solution.