Equivalent code for this Java code in C#
SecureRandom random = new SecureRandom();
byte randBytes[] = new byte[64];
random.nextBytes(randBytes);
MessageDigest md = MessageDigest.getInstance("SHA-512");
md.update(randBytes);
byte[] hash = md.digest();
byte[] encodedHash = Base64.encodeBase64(hash);
It should be:
Unclear the use of calculating the hash of some random bytes.
Note that technically in Java
encodedHashis in utf8 format. If you really want it in utf8: