I am trying to create a Hash for the API. my input looks something like this:
FBN | Web | 3QTC0001 | RS1 | 260214133217 | 000000131127897656
And my expected result is as follows:
17361DU87HT56F0O9967E34FDFFDFG7UO334665324308667FDGJKD66F9888766DFKKJJR466634HH6566734JHJH34766734NMBBN463499876554234343432456
I tried, but I keep getting "The specified value has invalid control characters. Parameter name: value"
I really do this in a REST service.
public static string GetHash(string text)
{
string hash = "";
SHA512 alg = SHA512.Create();
byte[] result = alg.ComputeHash(Encoding.UTF8.GetBytes(text));
hash = Encoding.UTF8.GetString(result);
return hash;
}
What am I missing?
Peter source
share