A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
if B4's value was POTATO, then the hash would be 0718efaf8b438e839194f164a83581519f3de4022d355f124b15b5f1aede6b25854c498f55776eca930647f1a82707f4782f2aa6538e25e07a3b9b8a0a9f17d5
Option Explicit
Private Sub Example_SHA512()
Debug.Print SHA512("POTATO")
End Sub
Function SHA512(ByVal S As String) As String
'https://msdn.microsoft.com/en-us/library/system.security.cryptography.sha512managed.aspx
Static UTF8 As Object, SHA As Object
Dim Data, Temp, i As Long
If SHA Is Nothing Then
Set UTF8 = CreateObject("System.Text.UTF8Encoding")
Set SHA = CreateObject("System.Security.Cryptography.SHA512Managed")
End If
Data = SHA.ComputeHash_2(UTF8.GetBytes_4(S))
ReDim Temp(LBound(Data) To UBound(Data)) As String
For i = LBound(Data) To UBound(Data)
Temp(i) = Right$("0" & Hex(Data(i)), 2)
Next
SHA512 = Join(Temp, "")
End Function